From: Aaron Schulz Date: Sat, 9 May 2015 01:59:42 +0000 (-0700) Subject: Unbreak --profile=text for CLI scrips X-Git-Tag: 1.31.0-rc.0~11451^2 X-Git-Url: http://git.cyclocoop.org/%22.%28%24lien.?a=commitdiff_plain;h=929b280b999db52a7abfa44d6e142aa8c86aa976;p=lhc%2Fweb%2Fwiklou.git Unbreak --profile=text for CLI scrips * Fixes "Undefined index: threshold" and "Invalid argument supplied for foreach()" errors so that output actually can show Change-Id: Ibf8090f265d988c58d1752319336a5146a28f4d0 --- diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index 3f804a0260..c97c6a35f4 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -603,7 +603,7 @@ abstract class Maintenance { * Activate the profiler (assuming $wgProfiler is set) */ protected function activateProfiler() { - global $wgProfiler, $wgTrxProfilerLimits; + global $wgProfiler, $wgProfileLimit, $wgTrxProfilerLimits; $output = $this->getOption( 'profiler' ); if ( !$output ) { @@ -613,7 +613,9 @@ abstract class Maintenance { if ( is_array( $wgProfiler ) && isset( $wgProfiler['class'] ) ) { $class = $wgProfiler['class']; $profiler = new $class( - array( 'sampling' => 1, 'output' => $output ) + $wgProfiler + array( 'sampling' => 1, 'output' => array( $output ) ) + + $wgProfiler + + array( 'threshold' => $wgProfileLimit ) ); $profiler->setTemplated( true ); Profiler::replaceStubInstance( $profiler );