From 1c13096d9b1bd91c8a75b6fd9d1ba48cb0d17918 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Sat, 16 Apr 2011 19:30:50 +0000 Subject: [PATCH] Followup r86228 (profiling cleanup): * 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 | 13 +++++++++++++ includes/profiler/ProfilerSimple.php | 13 ------------- includes/profiler/ProfilerSimpleTrace.php | 1 - 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/includes/profiler/Profiler.php b/includes/profiler/Profiler.php index 63f9a54184..2e02d2926e 100644 --- a/includes/profiler/Profiler.php +++ b/includes/profiler/Profiler.php @@ -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() * diff --git a/includes/profiler/ProfilerSimple.php b/includes/profiler/ProfilerSimple.php index d1b20bccc4..35cbae0f32 100644 --- a/includes/profiler/ProfilerSimple.php +++ b/includes/profiler/ProfilerSimple.php @@ -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) { diff --git a/includes/profiler/ProfilerSimpleTrace.php b/includes/profiler/ProfilerSimpleTrace.php index 0d73e498b2..664a6d95cf 100644 --- a/includes/profiler/ProfilerSimpleTrace.php +++ b/includes/profiler/ProfilerSimpleTrace.php @@ -11,7 +11,6 @@ */ class ProfilerSimpleTrace extends ProfilerSimple { var $mMinimumTime = 0; - var $mProfileID = false; var $trace = ""; var $memory = 0; -- 2.20.1