X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=profileinfo.php;h=95636093c65a68c122d72709d1ed58c3f98aa4d3;hb=0a5072c927660e26977ef304e9dad5549046d540;hp=f172cfb6f20918117ca4235033b43ecdd1f951d4;hpb=0cd36fec250ffb0afe87dc357abe42d723add3e0;p=lhc%2Fweb%2Fwiklou.git diff --git a/profileinfo.php b/profileinfo.php index f172cfb6f2..95636093c6 100644 --- a/profileinfo.php +++ b/profileinfo.php @@ -156,7 +156,7 @@ if ( !$dbr->tableExists( 'profiling' ) ) { exit( 1 ); } -$expand = array(); +$expand = []; if ( isset( $_REQUEST['expand'] ) ) { foreach ( explode( ',', $_REQUEST['expand'] ) as $f ) { $expand[$f] = true; @@ -179,7 +179,7 @@ class profile_point { $this->count = $count; $this->time = $time; $this->memory = $memory; - $this->children = array(); + $this->children = []; } public function add_child( $child ) { @@ -195,16 +195,16 @@ class profile_point { if ( !$ex ) { if ( count( $this->children ) ) { - $url = getEscapedProfileUrl( false, false, $expand + array( $this->name() => true ) ); + $url = getEscapedProfileUrl( false, false, $expand + [ $this->name() => true ] ); $extet = " [+]"; } else { $extet = ''; } } else { - $e = array(); + $e = []; foreach ( $expand as $name => $ep ) { if ( $name != $this->name() ) { - $e += array( $name => $ep ); + $e += [ $name => $ep ]; } } $url = getEscapedProfileUrl( false, false, $e ); @@ -313,14 +313,20 @@ function compare_point( profile_point $a, profile_point $b ) { } } -$sorts = array( 'time', 'memory', 'count', 'calls_per_req', 'name', - 'time_per_call', 'memory_per_call', 'time_per_req', 'memory_per_req' ); +$sorts = [ 'time', 'memory', 'count', 'calls_per_req', 'name', + 'time_per_call', 'memory_per_call', 'time_per_req', 'memory_per_req' ]; $sort = 'time'; if ( isset( $_REQUEST['sort'] ) && in_array( $_REQUEST['sort'], $sorts ) ) { $sort = $_REQUEST['sort']; } -$res = $dbr->select( 'profiling', '*', array(), 'profileinfo.php', array( 'ORDER BY' => 'pf_name ASC' ) ); +$res = $dbr->select( + 'profiling', + '*', + [], + 'profileinfo.php', + [ 'ORDER BY' => 'pf_name ASC' ] +); if ( isset( $_REQUEST['filter'] ) ) { $filter = $_REQUEST['filter']; @@ -333,7 +339,9 @@ if ( isset( $_REQUEST['filter'] ) ) {

- "> + ">

@@ -341,15 +349,33 @@ if ( isset( $_REQUEST['filter'] ) ) { - - - - - - - - - + + + + + + + + + @@ -369,16 +395,16 @@ if ( isset( $_REQUEST['filter'] ) ) { return htmlspecialchars( '?' . - wfArrayToCgi( array( + wfArrayToCgi( [ 'filter' => $_filter ? $_filter : $filter, 'sort' => $_sort ? $_sort : $sort, 'expand' => implode( ',', array_keys( $_expand ) ) - ) ) + ] ) ); } - $points = array(); - $queries = array(); + $points = []; + $queries = []; $sqltotal = 0.0; $last = false; @@ -410,7 +436,9 @@ if ( isset( $_REQUEST['filter'] ) ) { } $points[] = $s; - usort( $points, 'compare_point' ); + // @codingStandardsIgnoreStart + @usort( $points, 'compare_point' ); + // @codingStandardsIgnoreEnd foreach ( $points as $point ) { if ( strlen( $filter ) && !strstr( $point->name(), $filter ) ) {
NameTime (%)Memory (%)CountCalls/reqms/callkb/callms/reqkb/reqNameTime (%)Memory (%)CountCalls/reqms/callkb/callms/reqkb/req