From: Aaron Schulz Date: Mon, 19 Jan 2009 23:34:13 +0000 (+0000) Subject: Check $wgProfiling. This lets long running scripts disable profiling to avoid OOM... X-Git-Tag: 1.31.0-rc.0~43346 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=bcf216569406d7e1dd443ce232b593fad044b00b;p=lhc%2Fweb%2Fwiklou.git Check $wgProfiling. This lets long running scripts disable profiling to avoid OOM errors due to the growing work stack size. --- 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();