http://www.mediawiki.org/wiki/Special:Code/MediaWiki/76243

Revision: 76243
Author:   catrope
Date:     2010-11-07 12:43:41 +0000 (Sun, 07 Nov 2010)
Log Message:
-----------
1.16wmf4: Live hack to shut up fatals in Profiler.php . Tried to figure out why 
$wgProfiler isn't set here, but got nowhere

Modified Paths:
--------------
    branches/wmf/1.16wmf4/includes/Profiler.php

Modified: branches/wmf/1.16wmf4/includes/Profiler.php
===================================================================
--- branches/wmf/1.16wmf4/includes/Profiler.php 2010-11-07 11:54:48 UTC (rev 
76242)
+++ branches/wmf/1.16wmf4/includes/Profiler.php 2010-11-07 12:43:41 UTC (rev 
76243)
@@ -16,7 +16,10 @@
  */
 function wfProfileIn( $functionname ) {
        global $wgProfiler;
-       $wgProfiler->profileIn( $functionname );
+       # Live hack pending investigation why this code is even reached when 
$wgProfiler is not an object --catrope Nov 7 2010
+       if ( $wgProfiler ) {
+               $wgProfiler->profileIn( $functionname );
+       }
 }
 
 /**
@@ -25,7 +28,9 @@
  */
 function wfProfileOut( $functionname = 'missing' ) {
        global $wgProfiler;
-       $wgProfiler->profileOut( $functionname );
+       if ( $wgProfiler ) {
+               $wgProfiler->profileOut( $functionname );
+       }
 }
 
 /**
@@ -36,7 +41,9 @@
  */
 function wfGetProfilingOutput( $start, $elapsed ) {
        global $wgProfiler;
-       return $wgProfiler->getOutput( $start, $elapsed );
+       if ( $wgProfiler ) {
+               return $wgProfiler->getOutput( $start, $elapsed );
+       }
 }
 
 /**
@@ -44,7 +51,9 @@
  */
 function wfProfileClose() {
        global $wgProfiler;
-       $wgProfiler->close();
+       if ( $wgProfiler ) {
+               $wgProfiler->close();
+       }
 }
 
 if (!function_exists('memory_get_usage')) {


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to