Only configure the transaction profiler if profiling is enabled
authorOri Livneh <ori@wikimedia.org>
Thu, 7 May 2015 00:45:48 +0000 (17:45 -0700)
committerOri Livneh <ori@wikimedia.org>
Thu, 7 May 2015 00:45:48 +0000 (17:45 -0700)
Follows I0fe14bcda.

Change-Id: I4eb77d3b5ead587da6f01dec00fa6c5852225fcc

maintenance/Maintenance.php

index 50b8a01..3f804a0 100644 (file)
@@ -606,7 +606,11 @@ abstract class Maintenance {
                global $wgProfiler, $wgTrxProfilerLimits;
 
                $output = $this->getOption( 'profiler' );
-               if ( $output && is_array( $wgProfiler ) && isset( $wgProfiler['class'] ) ) {
+               if ( !$output ) {
+                       return;
+               }
+
+               if ( is_array( $wgProfiler ) && isset( $wgProfiler['class'] ) ) {
                        $class = $wgProfiler['class'];
                        $profiler = new $class(
                                array( 'sampling' => 1, 'output' => $output ) + $wgProfiler