* Added Profiler::addInitialStack() to separate definitions of local variables and...
[lhc/web/wiklou.git] / includes / profiler / Profiler.php
index b1ed9b6..f6d8b3a 100644 (file)
@@ -48,14 +48,7 @@ class Profiler {
                        $this->mProfileID = $params['profileID'];
                }
 
-               // Push an entry for the pre-profile setup time onto the stack
-               $initial = $this->getInitialTime();
-               if ( $initial !== null ) {
-                       $this->mWorkStack[] = array( '-total', 0, $initial, 0 );
-                       $this->mStack[] = array( '-setup', 1, $initial, 0, $this->getTime(), 0 );
-               } else {
-                       $this->profileIn( '-total' );
-               }
+               $this->addInitialStack();
        }
 
        /**
@@ -114,6 +107,20 @@ class Profiler {
                }
        }
 
+       /**
+        * Add the inital item in the stack.
+        */
+       protected function addInitialStack() {
+               // Push an entry for the pre-profile setup time onto the stack
+               $initial = $this->getInitialTime();
+               if ( $initial !== null ) {
+                       $this->mWorkStack[] = array( '-total', 0, $initial, 0 );
+                       $this->mStack[] = array( '-setup', 1, $initial, 0, $this->getTime(), 0 );
+               } else {
+                       $this->profileIn( '-total' );
+               }
+       }
+
        /**
         * Called by wfProfieIn()
         *