X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=profileinfo.php;h=aed2447c238f8b5a7e211582f5d06c6ed7da9bd2;hb=13d176d840f85a58dd1411621c0af93a3877bfa7;hp=8bd37dd4cb38259302cafd36dbeaf1113daa4677;hpb=f506a05aaa035b96537b33244b0f18b093048e97;p=lhc%2Fweb%2Fwiklou.git diff --git a/profileinfo.php b/profileinfo.php index 8bd37dd4cb..aed2447c23 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 ); @@ -167,6 +178,7 @@ if ( isset( $_REQUEST['expand'] ) ) { $expand[$f] = true; } } +wfDeprecated( 'profileinfo.php', '1.34' ); // phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps class profile_point { @@ -284,7 +296,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 +341,7 @@ $res = $dbr->select( [ 'ORDER BY' => 'pf_name ASC' ] ); -if ( isset( $_REQUEST['filter'] ) ) { - $filter = $_REQUEST['filter']; -} else { - $filter = ''; -} +$filter = $_REQUEST['filter'] ?? ''; ?>

@@ -407,6 +415,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 +439,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 ); }