From 222b01f5169f1c7e69762e0e8904c24f78f71882 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 28 Jul 2010 11:52:48 +0200 Subject: update to MediaWiki 1.16.0 --- includes/Profiler.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'includes/Profiler.php') diff --git a/includes/Profiler.php b/includes/Profiler.php index 80a6a68a..817b71ab 100644 --- a/includes/Profiler.php +++ b/includes/Profiler.php @@ -12,7 +12,7 @@ $wgProfiling = true; /** * Begin profiling of a function - * @param $functioname name of the function we will profile + * @param $functionname name of the function we will profile */ function wfProfileIn( $functionname ) { global $wgProfiler; @@ -21,7 +21,7 @@ function wfProfileIn( $functionname ) { /** * Stop profiling of a function - * @param $functioname name of the function we have profiled + * @param $functionname name of the function we have profiled */ function wfProfileOut( $functionname = 'missing' ) { global $wgProfiler; @@ -31,8 +31,8 @@ function wfProfileOut( $functionname = 'missing' ) { /** * Returns a profiling output to be stored in debug file * - * @param float $start - * @param float $elapsed time elapsed since the beginning of the request + * @param $start Float + * @param $elapsed Float: time elapsed since the beginning of the request */ function wfGetProfilingOutput( $start, $elapsed ) { global $wgProfiler; @@ -128,6 +128,12 @@ class Profiler { * called by wfProfileClose() */ function close() { + global $wgProfiling; + + # Avoid infinite loop + if( !$wgProfiling ) + return; + while( count( $this->mWorkStack ) ){ $this->profileOut( 'close' ); } @@ -253,6 +259,7 @@ class Profiler { wfProfileOut( '-overhead-total' ); # First, subtract the overhead! + $overheadTotal = $overheadMemory = $overheadInternal = array(); foreach( $this->mStack as $entry ){ $fname = $entry[0]; $start = $entry[2]; -- cgit v1.2.3-54-g00ecf