From: Chad Horohoe Date: Thu, 8 Sep 2011 14:53:07 +0000 (+0000) Subject: Show a more useful message when someone tries enabling profileinfo but hasn't created... X-Git-Tag: 1.31.0-rc.0~27793 X-Git-Url: http://git.cyclocoop.org/%22%20.%20%20%20%24self2%20.%20%20%20%22&var_mode_affiche=boucle?a=commitdiff_plain;h=018e6d5f3ded22c50a9bac336295d442a649c42e;p=lhc%2Fweb%2Fwiklou.git Show a more useful message when someone tries enabling profileinfo but hasn't created the table yet --- diff --git a/profileinfo.php b/profileinfo.php index 3117db31fd..b47033a723 100644 --- a/profileinfo.php +++ b/profileinfo.php @@ -78,6 +78,17 @@ if ( !$wgEnableProfileInfo ) { exit( 1 ); } +$dbr = wfGetDB( DB_SLAVE ); + +if( !$dbr->tableExists( 'profileinfo' ) ) { + echo "

No 'profileinfo' table exists, so we can't show you anything.

\n"; + echo "

If you want to log profiling data, create the table using " + . "maintenance/archives/patch-profiling.sql and enable " + . "\$wgProfileToDatabase.

\n"; + echo ""; + exit( 1 ); +} + $expand = array(); if ( isset( $_REQUEST['expand'] ) ) foreach( explode( ',', $_REQUEST['expand'] ) as $f ) @@ -218,8 +229,6 @@ $sort = 'time'; 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'] ) )