From 5cf7c777be7d6f3fa33629f27cc2b18e1e998eb3 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 19 Jul 2009 20:21:28 +0000 Subject: [PATCH] * (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 --- RELEASE-NOTES | 1 + includes/Setup.php | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) 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 ); -- 2.20.1