# of the extension file. This allows the extension to perform
# any necessary initialisation in the fully initialised environment
foreach ( $wgExtensionFunctions as $func ) {
- $profName = $fname.'-extensions-'.strval( $func );
+ # Allow closures in PHP 5.3+
+ if ( is_object( $func ) && $func instanceof Closure )
+ $profName = $fname.'-extensions-closure';
+ else
+ $profName = $fname.'-extensions-'.strval( $func );
+
wfProfileIn( $profName );
call_user_func( $func );
wfProfileOut( $profName );