From bcf216569406d7e1dd443ce232b593fad044b00b Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 19 Jan 2009 23:34:13 +0000 Subject: [PATCH] Check $wgProfiling. This lets long running scripts disable profiling to avoid OOM errors due to the growing work stack size. --- includes/Profiler.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/Profiler.php b/includes/Profiler.php index ffb489780e..0ea8e8ae0b 100644 --- a/includes/Profiler.php +++ b/includes/Profiler.php @@ -78,8 +78,8 @@ class Profiler { * @param $functionname string */ function profileIn( $functionname ) { - global $wgDebugFunctionEntry; - + global $wgDebugFunctionEntry, $wgProfiling; + if( !$wgProfiling ) return; if( $wgDebugFunctionEntry ){ $this->debug( str_repeat( ' ', count( $this->mWorkStack ) ) . 'Entering ' . $functionname . "\n" ); } @@ -92,8 +92,8 @@ class Profiler { * @param $functionname string */ function profileOut($functionname) { - global $wgDebugFunctionEntry; - + global $wgDebugFunctionEntry, $wgProfiling;; + if( !$wgProfiling ) return; $memory = memory_get_usage(); $time = $this->getTime(); -- 2.20.1