| Index: branches/wmf/1.16wmf4/includes/Profiler.php |
| — | — | @@ -16,7 +16,10 @@ |
| 17 | 17 | */ |
| 18 | 18 | function wfProfileIn( $functionname ) { |
| 19 | 19 | global $wgProfiler; |
| 20 | | - $wgProfiler->profileIn( $functionname ); |
| | 20 | + # Live hack pending investigation why this code is even reached when $wgProfiler is not an object --catrope Nov 7 2010 |
| | 21 | + if ( $wgProfiler ) { |
| | 22 | + $wgProfiler->profileIn( $functionname ); |
| | 23 | + } |
| 21 | 24 | } |
| 22 | 25 | |
| 23 | 26 | /** |
| — | — | @@ -25,7 +28,9 @@ |
| 26 | 29 | */ |
| 27 | 30 | function wfProfileOut( $functionname = 'missing' ) { |
| 28 | 31 | global $wgProfiler; |
| 29 | | - $wgProfiler->profileOut( $functionname ); |
| | 32 | + if ( $wgProfiler ) { |
| | 33 | + $wgProfiler->profileOut( $functionname ); |
| | 34 | + } |
| 30 | 35 | } |
| 31 | 36 | |
| 32 | 37 | /** |
| — | — | @@ -36,7 +41,9 @@ |
| 37 | 42 | */ |
| 38 | 43 | function wfGetProfilingOutput( $start, $elapsed ) { |
| 39 | 44 | global $wgProfiler; |
| 40 | | - return $wgProfiler->getOutput( $start, $elapsed ); |
| | 45 | + if ( $wgProfiler ) { |
| | 46 | + return $wgProfiler->getOutput( $start, $elapsed ); |
| | 47 | + } |
| 41 | 48 | } |
| 42 | 49 | |
| 43 | 50 | /** |
| — | — | @@ -44,7 +51,9 @@ |
| 45 | 52 | */ |
| 46 | 53 | function wfProfileClose() { |
| 47 | 54 | global $wgProfiler; |
| 48 | | - $wgProfiler->close(); |
| | 55 | + if ( $wgProfiler ) { |
| | 56 | + $wgProfiler->close(); |
| | 57 | + } |
| 49 | 58 | } |
| 50 | 59 | |
| 51 | 60 | if (!function_exists('memory_get_usage')) { |