Index: trunk/phase3/profileinfo.php |
— | — | @@ -78,6 +78,17 @@ |
79 | 79 | exit( 1 ); |
80 | 80 | } |
81 | 81 | |
| 82 | +$dbr = wfGetDB( DB_SLAVE ); |
| 83 | + |
| 84 | +if( !$dbr->tableExists( 'profileinfo' ) ) { |
| 85 | + echo "<p>No 'profileinfo' table exists, so we can't show you anything.</p>\n"; |
| 86 | + echo "<p>If you want to log profiling data, create the table using " |
| 87 | + . "<tt>maintenance/archives/patch-profiling.sql</tt> and enable " |
| 88 | + . "<tt>\$wgProfileToDatabase</tt>.</p>\n"; |
| 89 | + echo "</body></html>"; |
| 90 | + exit( 1 ); |
| 91 | +} |
| 92 | + |
82 | 93 | $expand = array(); |
83 | 94 | if ( isset( $_REQUEST['expand'] ) ) |
84 | 95 | foreach( explode( ',', $_REQUEST['expand'] ) as $f ) |
— | — | @@ -218,8 +229,6 @@ |
219 | 230 | if ( isset( $_REQUEST['sort'] ) && in_array( $_REQUEST['sort'], $sorts ) ) |
220 | 231 | $sort = $_REQUEST['sort']; |
221 | 232 | |
222 | | - |
223 | | -$dbr = wfGetDB( DB_SLAVE ); |
224 | 233 | $res = $dbr->select( 'profiling', '*', array(), 'profileinfo.php', array( 'ORDER BY' => 'pf_name ASC' ) ); |
225 | 234 | |
226 | 235 | if (isset( $_REQUEST['filter'] ) ) |