Index: trunk/extensions/RandomImage/RandomImage.php |
— | — | @@ -12,7 +12,6 @@ |
13 | 13 | if( defined( 'MEDIAWIKI' ) ) { |
14 | 14 | |
15 | 15 | $wgAutoloadClasses['RandomImage'] = dirname( __FILE__ ) . '/RandomImage.class.php'; |
16 | | - $wgExtensionFunctions[] = 'efRandomImage'; |
17 | 16 | $wgExtensionCredits['parserhook'][] = array( |
18 | 17 | 'name' => 'RandomImage', |
19 | 18 | 'author' => 'Rob Church', |
— | — | @@ -23,6 +22,8 @@ |
24 | 23 | 'descriptionmsg' => 'randomimage-desc', |
25 | 24 | ); |
26 | 25 | $wgExtensionMessagesFiles['RandomImage'] = dirname(__FILE__) . '/RandomImage.i18n.php'; |
| 26 | + $wgHooks['ParserAfterStrip'][] = 'RandomImage::stripHook'; |
| 27 | + $wgHooks['ParserFirstCallInit'][] = 'efRandomImage'; |
27 | 28 | |
28 | 29 | /** |
29 | 30 | * Set this to true to disable the parser cache for pages which |
— | — | @@ -40,10 +41,9 @@ |
41 | 42 | /** |
42 | 43 | * Extension initialisation function |
43 | 44 | */ |
44 | | - function efRandomImage() { |
45 | | - global $wgParser, $wgHooks; |
46 | | - $wgParser->setHook( 'randomimage', 'RandomImage::renderHook' ); |
47 | | - $wgHooks['ParserAfterStrip'][] = 'RandomImage::stripHook'; |
| 45 | + function efRandomImage($parser) { |
| 46 | + $parser->setHook( 'randomimage', 'RandomImage::renderHook' ); |
| 47 | + return true; |
48 | 48 | } |
49 | 49 | |
50 | 50 | } else { |