X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=profileinfo.php;h=dccdd38ff6a1ca01d8585b07936fa87053b41481;hb=26faca6a208149c633573afd64b046acf73d53a9;hp=9ebd57b7a241e389056601d7ccc3c740a93773e8;hpb=91dd393b4c044588a4df0674b1e9035a0bf06feb;p=lhc%2Fweb%2Fwiklou.git diff --git a/profileinfo.php b/profileinfo.php index 9ebd57b7a2..dccdd38ff6 100644 --- a/profileinfo.php +++ b/profileinfo.php @@ -1,6 +1,17 @@ tableExists( 'profiling' ) ) { echo '

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

' . '

If you want to log profiling data, enable $wgProfiler[\'output\'] = \'db\'' - . ' in your StartProfiler.php and run maintenance/update.php to' + . ' in LocalSettings.php and run maintenance/update.php to' . ' create the profiling table.' . ''; exit( 1 ); @@ -284,7 +293,7 @@ class profile_point { public function fmttime() { return sprintf( '%5.02f', $this->time ); } -}; +} function compare_point( profile_point $a, profile_point $b ) { // phpcs:ignore MediaWiki.NamingConventions.ValidGlobalName.wgPrefix @@ -329,11 +338,7 @@ $res = $dbr->select( [ 'ORDER BY' => 'pf_name ASC' ] ); -if ( isset( $_REQUEST['filter'] ) ) { - $filter = $_REQUEST['filter']; -} else { - $filter = ''; -} +$filter = $_REQUEST['filter'] ?? ''; ?>

@@ -396,8 +401,8 @@ if ( isset( $_REQUEST['filter'] ) ) { return htmlspecialchars( '?' . wfArrayToCgi( [ - 'filter' => $_filter ? $_filter : $filter, - 'sort' => $_sort ? $_sort : $sort, + 'filter' => $_filter ?: $filter, + 'sort' => $_sort ?: $sort, 'expand' => implode( ',', array_keys( $_expand ) ) ] ) ); @@ -407,6 +412,7 @@ if ( isset( $_REQUEST['filter'] ) ) { $queries = []; $sqltotal = 0.0; + /** @var profile_point|false $last */ $last = false; foreach ( $res as $o ) { $next = new profile_point( $o->pf_name, $o->pf_count, $o->pf_time, $o->pf_memory ); @@ -430,7 +436,7 @@ if ( isset( $_REQUEST['filter'] ) ) { } } - $s = new profile_point( 'SQL Queries', 0, $sqltotal, 0, 0 ); + $s = new profile_point( 'SQL Queries', 0, $sqltotal, 0 ); foreach ( $queries as $q ) { $s->add_child( $q ); }