Index: trunk/extensions/RandomImage/RandomImage.php |
— | — | @@ -23,7 +23,7 @@ |
24 | 24 | ); |
25 | 25 | $wgExtensionMessagesFiles['RandomImage'] = dirname(__FILE__) . '/RandomImage.i18n.php'; |
26 | 26 | $wgHooks['ParserAfterStrip'][] = 'RandomImage::stripHook'; |
27 | | - $wgHooks['ParserFirstCallInit'][] = 'efRandomImage'; |
| 27 | + $wgExtensionFunctions[] = 'efRandomImageSetup'; |
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Set this to true to disable the parser cache for pages which |
— | — | @@ -41,6 +41,15 @@ |
42 | 42 | /** |
43 | 43 | * Extension initialisation function |
44 | 44 | */ |
| 45 | + function efRandomImageSetup() { |
| 46 | + if(defined('MW_SUPPORTS_PARSERFIRSTCALLINIT')) { |
| 47 | + global $wgHooks; |
| 48 | + $wgHooks['ParserFirstCallInit'][] = 'efRandomImage'; |
| 49 | + } else { |
| 50 | + global $wgParser; |
| 51 | + efRandomImage($wgParser); |
| 52 | + } |
| 53 | + } |
45 | 54 | function efRandomImage($parser) { |
46 | 55 | $parser->setHook( 'randomimage', 'RandomImage::renderHook' ); |
47 | 56 | return true; |
Index: trunk/extensions/redircite/redircite.php |
— | — | @@ -24,8 +24,17 @@ |
25 | 25 | 'url' => 'http://www.mediawiki.org/wiki/Extension:Redircite' |
26 | 26 | ); |
27 | 27 | |
| 28 | +$wgExtensionFunctions[] = 'efRedircite'; |
28 | 29 | $wgHooks['ParserAfterTidy'][] = 'redircite_afterTidy'; |
29 | | -$wgHooks['ParserFirstCallInit'][] = 'redircite_setup'; |
| 30 | +function efRedircite() { |
| 31 | + if(defined('MW_SUPPORTS_PARSERFIRSTCALLINIT')) { |
| 32 | + global $wgHooks; |
| 33 | + $wgHooks['ParserFirstCallInit'][] = 'redircite_setup'; |
| 34 | + } else { |
| 35 | + global $wgParser; |
| 36 | + redircite_setup($wgParser); |
| 37 | + } |
| 38 | +} |
30 | 39 | function redircite_setup($parser) { |
31 | 40 | $parser->setHook('redircite', 'redircite_render'); |
32 | 41 | return true; |