X-Git-Url: https://git.cyclocoop.org/%28%28?a=blobdiff_plain;f=includes%2Fprofiler%2FProfilerStandard.php;h=4ce88bdbcc29dcc529995178c77367815bef14d9;hb=90fd90d8ce3926e448c525138f644b74231e6402;hp=b40519e089c6ed85ac59c2316f1b6725d3817643;hpb=90a3418cf27021e1c56323e453ffac2b0e49f9ea;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/profiler/ProfilerStandard.php b/includes/profiler/ProfilerStandard.php index b40519e089..4ce88bdbcc 100644 --- a/includes/profiler/ProfilerStandard.php +++ b/includes/profiler/ProfilerStandard.php @@ -345,7 +345,9 @@ class ProfilerStandard extends Profiler { $this->close(); // set "-total" entry if ( $this->collateOnly ) { - return; // already collated as methods exited + // already collated as methods exited + $this->sortCollated(); + return; } $this->collated = array(); @@ -400,7 +402,21 @@ class ProfilerStandard extends Profiler { } $this->collated['-overhead-total']['count'] = $profileCount; - arsort( $this->collated, SORT_NUMERIC ); + $this->sortCollated(); + } + + protected function sortCollated() { + uksort( $this->collated, function ( $a, $b ) { + $ca = $this->collated[$a]['real']; + $cb = $this->collated[$b]['real']; + if ( $ca > $cb ) { + return -1; + } elseif ( $cb > $ca ) { + return 1; + } else { + return 0; + } + } ); } /**