Fix for r89206, r89218: always supply constructor parameters
authorTim Starling <tstarling@users.mediawiki.org>
Tue, 31 May 2011 23:50:11 +0000 (23:50 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Tue, 31 May 2011 23:50:11 +0000 (23:50 +0000)
includes/profiler/Profiler.php
includes/profiler/ProfilerSimple.php
includes/profiler/ProfilerSimpleText.php
includes/profiler/ProfilerSimpleTrace.php

index 1358828..78ea912 100644 (file)
@@ -42,7 +42,7 @@ class Profiler {
        protected $mProfileID = false;
        private static $__instance = null;
 
-       function __construct( $params = null ) {
+       function __construct( $params ) {
                // Push an entry for the pre-profile setup time onto the stack
                global $wgRequestTime;
                if ( !empty( $wgRequestTime ) ) {
@@ -69,7 +69,7 @@ class Profiler {
                        } elseif( $wgProfiler instanceof Profiler ) {
                                self::$__instance = $wgProfiler; // back-compat
                        } else {
-                               self::$__instance = new ProfilerStub;
+                               self::$__instance = new ProfilerStub( $wgProfiler );
                        }
                }
                return self::$__instance;
index 8f1c621..2bfc5e0 100644 (file)
@@ -12,8 +12,9 @@
 class ProfilerSimple extends Profiler {
        var $mMinimumTime = 0;
 
-       function __construct() {
+       function __construct( $params ) {
                global $wgRequestTime, $wgRUstart;
+               parent::__construct( $params );
                if (!empty($wgRequestTime) && !empty($wgRUstart)) {
                        $this->mWorkStack[] = array( '-total', 0, $wgRequestTime,$this->getCpuTime($wgRUstart));
 
index fccfb92..49ad02b 100644 (file)
@@ -22,7 +22,7 @@ class ProfilerSimpleText extends ProfilerSimple {
                if( isset( $profileConfig['visible'] ) && $profileConfig['visible'] ) {
                        $this->visible = true;
                }
-               parent::__construct();
+               parent::__construct( $profileConfig );
        }
 
        public function logData() {
index 1e0d204..ba41bab 100644 (file)
@@ -14,8 +14,9 @@ class ProfilerSimpleTrace extends ProfilerSimple {
        var $trace = "";
        var $memory = 0;
 
-       function __construct() {
+       function __construct( $params ) {
                global $wgRequestTime, $wgRUstart;
+               parent::__construct( $params );
                if ( !empty( $wgRequestTime ) && !empty( $wgRUstart ) ) {
                        $this->mWorkStack[] = array( '-total', 0, $wgRequestTime, $this->getCpuTime( $wgRUstart ) );
                }