Back-compat for $wgProfiler set as a class. Fix for r89206
authorChad Horohoe <demon@users.mediawiki.org>
Mon, 19 Sep 2011 23:25:13 +0000 (23:25 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Mon, 19 Sep 2011 23:25:13 +0000 (23:25 +0000)
includes/profiler/Profiler.php

index 1fc7b0e..bb6ab13 100644 (file)
@@ -13,7 +13,7 @@
  */
 function wfProfileIn( $functionname ) {
        global $wgProfiler;
-       if ( isset( $wgProfiler['class'] ) ) {
+       if ( $wgProfiler instanceof Profiler || isset( $wgProfiler['class'] ) ) {
                Profiler::instance()->profileIn( $functionname );
        }
 }
@@ -24,7 +24,7 @@ function wfProfileIn( $functionname ) {
  */
 function wfProfileOut( $functionname = 'missing' ) {
        global $wgProfiler;
-       if ( isset( $wgProfiler['class'] ) ) {
+       if ( $wgProfiler instanceof Profiler || isset( $wgProfiler['class'] ) ) {
                Profiler::instance()->profileOut( $functionname );
        }
 }