Followup r86228 (profiling cleanup):
authorChad Horohoe <demon@users.mediawiki.org>
Sat, 16 Apr 2011 19:30:50 +0000 (19:30 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Sat, 16 Apr 2011 19:30:50 +0000 (19:30 +0000)
* Move autoloader up in Maintenance as well
* Add setInstance() method to Profiler, dumpHTML will need it
* Move get/setProfileId() up a level to Profiler. ProfilerSimple subclasses use it, behavior is harmless for Stub.

includes/profiler/Profiler.php
includes/profiler/ProfilerSimple.php
includes/profiler/ProfilerSimpleTrace.php

index 63f9a54..2e02d29 100644 (file)
@@ -61,6 +61,7 @@ class Profiler {
        var $mStack = array (), $mWorkStack = array (), $mCollated = array ();
        var $mCalls = array (), $mTotals = array ();
        var $mTemplated = false;
+       protected $mProfileID = false;
        private static $__instance = null;
 
        function __construct() {
@@ -102,6 +103,18 @@ class Profiler {
                self::$__instance = $p;
        }
 
+       public function setProfileID( $id ) {
+               $this->mProfileID = $id;
+       }
+
+       public function getProfileID() {
+               if ( $this->mProfileID === false ) {
+                       return wfWikiID();
+               } else {
+                       return $this->mProfileID;
+               }
+       }
+
        /**
         * Called by wfProfieIn()
         *
index d1b20bc..35cbae0 100644 (file)
@@ -11,7 +11,6 @@
  */
 class ProfilerSimple extends Profiler {
        var $mMinimumTime = 0;
-       var $mProfileID = false;
 
        function __construct() {
                global $wgRequestTime, $wgRUstart;
@@ -38,18 +37,6 @@ class ProfilerSimple extends Profiler {
                $this->mMinimumTime = $min;
        }
 
-       function setProfileID( $id ) {
-               $this->mProfileID = $id;
-       }
-
-       function getProfileID() {
-               if ( $this->mProfileID === false ) {
-                       return wfWikiID();
-               } else {
-                       return $this->mProfileID;
-               }
-       }
-
        function profileIn($functionname) {
                global $wgDebugFunctionEntry;
                if ($wgDebugFunctionEntry) {
index 0d73e49..664a6d9 100644 (file)
@@ -11,7 +11,6 @@
  */
 class ProfilerSimpleTrace extends ProfilerSimple {
        var $mMinimumTime = 0;
-       var $mProfileID = false;
        var $trace = "";
        var $memory = 0;