Check $wgProfiling. This lets long running scripts disable profiling to avoid OOM...
authorAaron Schulz <aaron@users.mediawiki.org>
Mon, 19 Jan 2009 23:34:13 +0000 (23:34 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Mon, 19 Jan 2009 23:34:13 +0000 (23:34 +0000)
includes/Profiler.php

index ffb4897..0ea8e8a 100644 (file)
@@ -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();