r76243 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76242‎ | r76243 | r76244 >
Date:12:43, 7 November 2010
Author:catrope
Status:ok (Comments)
Tags:
Comment:
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) (history)

Diff [purge]

Index: branches/wmf/1.16wmf4/includes/Profiler.php
@@ -16,7 +16,10 @@
1717 */
1818 function wfProfileIn( $functionname ) {
1919 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+ }
2124 }
2225
2326 /**
@@ -25,7 +28,9 @@
2629 */
2730 function wfProfileOut( $functionname = 'missing' ) {
2831 global $wgProfiler;
29 - $wgProfiler->profileOut( $functionname );
 32+ if ( $wgProfiler ) {
 33+ $wgProfiler->profileOut( $functionname );
 34+ }
3035 }
3136
3237 /**
@@ -36,7 +41,9 @@
3742 */
3843 function wfGetProfilingOutput( $start, $elapsed ) {
3944 global $wgProfiler;
40 - return $wgProfiler->getOutput( $start, $elapsed );
 45+ if ( $wgProfiler ) {
 46+ return $wgProfiler->getOutput( $start, $elapsed );
 47+ }
4148 }
4249
4350 /**
@@ -44,7 +51,9 @@
4552 */
4653 function wfProfileClose() {
4754 global $wgProfiler;
48 - $wgProfiler->close();
 55+ if ( $wgProfiler ) {
 56+ $wgProfiler->close();
 57+ }
4958 }
5059
5160 if (!function_exists('memory_get_usage')) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r97492Also comment out r76243, it won't merge cleanly due to path changes, and it l...reedy13:49, 19 September 2011

Comments

#Comment by Platonides (talk | contribs)   10:23, 22 February 2011

Time to retry now that we have wmerrors?

Status & tagging log