Index: trunk/extensions/ImageMap/ImageMap.php |
— | — | @@ -6,7 +6,7 @@ |
7 | 7 | if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) ) { |
8 | 8 | $wgHooks['ParserFirstCallInit'][] = 'wfSetupImageMap'; |
9 | 9 | } else { |
10 | | - $wgExtensionFunctions[] = 'wfSetupImageMap'; |
| 10 | + $wgExtensionFunctions[] = 'wfSetupImageMap_legacy'; |
11 | 11 | } |
12 | 12 | |
13 | 13 | $wgExtensionCredits['parserhook']['ImageMap'] = array( |
— | — | @@ -18,8 +18,13 @@ |
19 | 19 | 'descriptionmsg' => 'imagemap_desc', |
20 | 20 | ); |
21 | 21 | |
22 | | -function wfSetupImageMap() { |
23 | | - global $wgParser; |
24 | | - $wgParser->setHook( 'imagemap', array( 'ImageMap', 'render' ) ); |
| 22 | +function wfSetupImageMap( &$parser ) { |
| 23 | + $parser->setHook( 'imagemap', array( 'ImageMap', 'render' ) ); |
25 | 24 | return true; |
26 | 25 | } |
| 26 | + |
| 27 | +/* Provided for pre-1.12 MediaWiki compatibility. */ |
| 28 | +function wfSetupImageMap_legacy() { |
| 29 | + global $wgParser; |
| 30 | + return wfSetupImageMap( $wgParser ); |
| 31 | +} |
Index: trunk/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php |
— | — | @@ -59,15 +59,20 @@ |
60 | 60 | if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) ) { |
61 | 61 | $wgHooks['ParserFirstCallInit'][] = 'efSyntaxHighlight_GeSHiSetup'; |
62 | 62 | } else { |
63 | | - $wgExtensionFunctions[] = 'efSyntaxHighlight_GeSHiSetup'; |
| 63 | + $wgExtensionFunctions[] = 'efSyntaxHighlight_GeSHiSetup_legacy'; |
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
67 | 67 | * Register parser hook |
68 | 68 | */ |
69 | | -function efSyntaxHighlight_GeSHiSetup() { |
70 | | - global $wgParser; |
71 | | - $wgParser->setHook( 'source', array( 'SyntaxHighlight_GeSHi', 'parserHook' ) ); |
72 | | - $wgParser->setHook( 'syntaxhighlight', array( 'SyntaxHighlight_GeSHi', 'parserHook' ) ); |
| 69 | +function efSyntaxHighlight_GeSHiSetup( &$parser ) { |
| 70 | + $parser->setHook( 'source', array( 'SyntaxHighlight_GeSHi', 'parserHook' ) ); |
| 71 | + $parser->setHook( 'syntaxhighlight', array( 'SyntaxHighlight_GeSHi', 'parserHook' ) ); |
73 | 72 | return true; |
74 | 73 | } |
| 74 | + |
| 75 | +/* Provided for pre-1.12 MediaWiki compatibility. */ |
| 76 | +function efSyntaxHighlight_GeSHiSetup_legacy() { |
| 77 | + global $wgParser; |
| 78 | + return efSyntaxHighlight_GeSHiSetup( $wgParser ); |
| 79 | +} |