From: Brion Vibber Date: Sun, 19 Jul 2009 20:21:28 +0000 (+0000) Subject: * (bug 18751) Fix for buggage in profiling setup for some extensions on PHP 5.1 X-Git-Tag: 1.31.0-rc.0~40829 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=5cf7c777be7d6f3fa33629f27cc2b18e1e998eb3;p=lhc%2Fweb%2Fwiklou.git * (bug 18751) Fix for buggage in profiling setup for some extensions on PHP 5.1 Patch by GreenReaper: http://bug-attachment.wikimedia.org/attachment.cgi?id=6246 --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 2cb95299f4..ec8564c0a5 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/Setup.php b/includes/Setup.php index 20b479905a..0021f5f9eb 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -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 );