http://www.mediawiki.org/wiki/Special:Code/MediaWiki/96569
Revision: 96569
Author: demon
Date: 2011-09-08 14:53:07 +0000 (Thu, 08 Sep 2011)
Log Message:
-----------
Show a more useful message when someone tries enabling profileinfo but hasn't
created the table yet
Modified Paths:
--------------
trunk/phase3/profileinfo.php
Modified: trunk/phase3/profileinfo.php
===================================================================
--- trunk/phase3/profileinfo.php 2011-09-08 14:46:21 UTC (rev 96568)
+++ trunk/phase3/profileinfo.php 2011-09-08 14:53:07 UTC (rev 96569)
@@ -78,6 +78,17 @@
exit( 1 );
}
+$dbr = wfGetDB( DB_SLAVE );
+
+if( !$dbr->tableExists( 'profileinfo' ) ) {
+ echo "<p>No 'profileinfo' table exists, so we can't show you
anything.</p>\n";
+ echo "<p>If you want to log profiling data, create the table using "
+ . "<tt>maintenance/archives/patch-profiling.sql</tt> and enable
"
+ . "<tt>\$wgProfileToDatabase</tt>.</p>\n";
+ echo "</body></html>";
+ exit( 1 );
+}
+
$expand = array();
if ( isset( $_REQUEST['expand'] ) )
foreach( explode( ',', $_REQUEST['expand'] ) as $f )
@@ -218,8 +229,6 @@
if ( isset( $_REQUEST['sort'] ) && in_array( $_REQUEST['sort'], $sorts ) )
$sort = $_REQUEST['sort'];
-
-$dbr = wfGetDB( DB_SLAVE );
$res = $dbr->select( 'profiling', '*', array(), 'profileinfo.php', array(
'ORDER BY' => 'pf_name ASC' ) );
if (isset( $_REQUEST['filter'] ) )
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs