* (bug 18751) Fix for buggage in profiling setup for some extensions on PHP 5.1
authorBrion Vibber <brion@users.mediawiki.org>
Sun, 19 Jul 2009 20:21:28 +0000 (20:21 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sun, 19 Jul 2009 20:21:28 +0000 (20:21 +0000)
Patch by GreenReaper: http://bug-attachment.wikimedia.org/attachment.cgi?id=6246

RELEASE-NOTES
includes/Setup.php

index 2cb9529..ec8564c 100644 (file)
@@ -296,6 +296,7 @@ this. Was used when mwEmbed was going to be an extension.
 * (bug 19355) Added .xhtml, .xht to upload file extension blacklist
 * (bug 19287) Workaround for lag on history page in Firefox 3.5
 * (bug 19564) Updated docs/hooks.txt
+* (bug 18751) Fix for buggage in profiling setup for some extensions on PHP 5.1
 
 == API changes in 1.16 ==
 
index 20b4799..0021f5f 100644 (file)
@@ -327,12 +327,16 @@ if( $wgEnableScriptLoader && strpos( wfGetScriptUrl(), "mwScriptLoader.php" ) !=
 # any necessary initialisation in the fully initialised environment
 foreach ( $wgExtensionFunctions as $func ) {
        # Allow closures in PHP 5.3+
-       if ( is_object( $func ) && $func instanceof Closure )
+       if ( is_object( $func ) && $func instanceof Closure ) {
                $profName = $fname.'-extensions-closure';
-       elseif( is_array( $func ) )
-               $profName = $fname.'-extensions-'.implode( '::', $func );
-       else
+       } elseif( is_array( $func ) ) {
+               if ( is_object( $func[0] ) )
+                       $profName = $fname.'-extensions-'.get_class( $func[0] ).'::'.$func[1];
+               else
+                       $profName = $fname.'-extensions-'.implode( '::', $func );
+       } else {
                $profName = $fname.'-extensions-'.strval( $func );
+       }
 
        wfProfileIn( $profName );
        call_user_func( $func );