Index: trunk/extensions/Plotters/Plotters.php |
— | — | @@ -33,8 +33,7 @@ |
34 | 34 | 'url' => 'http://www.mediawiki.org/wiki/Extension:Plotters', |
35 | 35 | ); |
36 | 36 | |
37 | | -$wgExtensionFunctions[] = "efPlotters"; |
38 | | - |
| 37 | +$wgHooks['ParserFirstCallInit'][] = 'efPlottersSetHooks'; |
39 | 38 | $wgHooks['OutputPageParserOutput'][] = 'PlottersParserOutput'; |
40 | 39 | if( version_compare( $wgVersion, '1.16alpha', '<' ) ) { |
41 | 40 | $wgHooks['LanguageGetMagic'][] = 'PlottersLanguageGetMagic'; |
— | — | @@ -165,11 +164,10 @@ |
166 | 165 | } |
167 | 166 | } |
168 | 167 | |
169 | | -function efPlotters() { |
170 | | - global $wgParser; |
171 | | - |
172 | | - $wgParser->setHook( 'plot', 'initPlotters' ); |
173 | | - $wgParser->setFunctionHook( 'plot', 'initPlottersPF' ); |
| 168 | +function efPlottersSetHooks( $parser ) { |
| 169 | + $parser->setHook( 'plot', 'initPlotters' ); |
| 170 | + $parser->setFunctionHook( 'plot', 'initPlottersPF' ); |
| 171 | + return true; |
174 | 172 | } |
175 | 173 | |
176 | 174 | function initPlottersPF( $parser ) { |
Index: trunk/extensions/PageBy/PageBy.php |
— | — | @@ -24,13 +24,13 @@ |
25 | 25 | |
26 | 26 | $dir = dirname(__FILE__) . '/'; |
27 | 27 | $wgExtensionMessagesFiles['PageBy'] = $dir . 'PageBy.i18n.php'; |
28 | | -$wgExtensionFunctions[] = "wfPageByExtension"; |
| 28 | +$wgHooks['ParserFirstCallInit'][] = "wfPageBySetHooks"; |
29 | 29 | |
30 | 30 | $wgAutoloadClasses['PageByRenderer'] = $dir. 'PageByRenderer.php'; |
31 | 31 | |
32 | | -function wfPageByExtension() { |
33 | | - global $wgParser; |
34 | | - $wgParser->setHook( "pageby", "newsxRenderPageBy" ); |
| 32 | +function wfPageBySetHooks( $parser ) { |
| 33 | + $parser->setHook( 'pageby', 'newsxRenderPageBy' ); |
| 34 | + return true; |
35 | 35 | } |
36 | 36 | |
37 | 37 | function newsxRenderPageBy( $page, $argv, $parser ) { |
Index: trunk/extensions/QPoll/qp_user.php |
— | — | @@ -251,7 +251,7 @@ |
252 | 252 | /** |
253 | 253 | * Register the extension with the WikiText parser. |
254 | 254 | */ |
255 | | - static function onParserFirstCallInit() { |
| 255 | + static function onParserFirstCallInit( $parser ) { |
256 | 256 | global $wgOut, $wgTitle; |
257 | 257 | if ( !is_object( $wgTitle ) || $wgTitle->getNamespace() === NS_SPECIAL ) { |
258 | 258 | # special page will add it's proper module itself; |
— | — | @@ -274,13 +274,12 @@ |
275 | 275 | $wgOut->addExtensionStyle( self::$ScriptPath . '/qp_user_rtl.css' ); |
276 | 276 | } |
277 | 277 | } |
278 | | - global $wgParser; |
279 | 278 | global $wgQPollFunctionsHook; |
280 | 279 | # setup tag hook |
281 | | - $wgParser->setHook( 'qpoll', array( 'qp_Setup', 'renderPoll' ) ); |
| 280 | + $parser->setHook( 'qpoll', array( 'qp_Setup', 'renderPoll' ) ); |
282 | 281 | $wgQPollFunctionsHook = new qp_FunctionsHook(); |
283 | 282 | # setup function hook |
284 | | - $wgParser->setFunctionHook( 'qpuserchoice', array( &$wgQPollFunctionsHook, 'qpuserchoice' ), SFH_OBJECT_ARGS ); |
| 283 | + $parser->setFunctionHook( 'qpuserchoice', array( &$wgQPollFunctionsHook, 'qpuserchoice' ), SFH_OBJECT_ARGS ); |
285 | 284 | return true; |
286 | 285 | } |
287 | 286 | |
Index: trunk/extensions/Player/Player.php |
— | — | @@ -23,7 +23,7 @@ |
24 | 24 | 'descriptionmsg' => 'player-desc', |
25 | 25 | ); |
26 | 26 | |
27 | | -$wgExtensionFunctions[] = "playerSetup"; |
| 27 | +$wgHooks['ParserFirstCallInit'][] = 'playerSetup'; |
28 | 28 | $wgHooks['OutputPageParserOutput'][] = 'playerParserOutput'; |
29 | 29 | |
30 | 30 | $dir = dirname(__FILE__) . '/'; |
— | — | @@ -44,10 +44,9 @@ |
45 | 45 | |
46 | 46 | require_once( dirname( __FILE__ ) . '/PlayerDefaultSettings.php' ); |
47 | 47 | |
48 | | -function playerSetup() { |
49 | | - global $wgParser; |
50 | | - |
51 | | - $wgParser->setHook( "player", "renderPlayerTag" ); |
| 48 | +function playerSetup( $parser ) { |
| 49 | + $parser->setHook( 'player', 'renderPlayerTag' ); |
| 50 | + return true; |
52 | 51 | } |
53 | 52 | |
54 | 53 | function renderPlayerTag( $name, $args, &$parser ) { |
— | — | @@ -123,7 +122,7 @@ |
124 | 123 | * Hook callback that injects messages and things into the <head> tag |
125 | 124 | * Does nothing if $parserOutput->mPlayerTag is not set |
126 | 125 | */ |
127 | | -function playerParserOutput( &$outputPage, &$parserOutput ) { |
| 126 | +function playerParserOutput( &$outputPage, $parserOutput ) { |
128 | 127 | if ( !empty( $parserOutput->mPlayerTag ) ) { |
129 | 128 | Player::setHeaders( $outputPage ); |
130 | 129 | } |
Index: trunk/extensions/News/News.php |
— | — | @@ -29,21 +29,20 @@ |
30 | 30 | $wgNewsFeedURLPattern = false; // pattern for feed-URLs; useful when using rewrites for canonical feed URLs |
31 | 31 | $wgNewsFeedUserPattern = false; // pattern to use for the author-field in feed items. |
32 | 32 | |
33 | | -$wgExtensionFunctions[] = "wfNewsExtension"; |
34 | | - |
35 | 33 | $wgAutoloadClasses['NewsRenderer'] = dirname( __FILE__ ) . '/NewsRenderer.php'; |
36 | 34 | $wgAutoloadClasses['NewsFeedPage'] = dirname( __FILE__ ) . '/NewsRenderer.php'; |
37 | 35 | $wgHooks['ArticleFromTitle'][] = 'wfNewsArticleFromTitle'; |
38 | 36 | $wgHooks['SkinTemplateOutputPageBeforeExec'][] = 'wfNewsSkinTemplateOutputPageBeforeExec'; |
| 37 | +$wgHooks['ParserFirstCallInit'][] = 'wfNewsSetHooks'; |
39 | 38 | |
40 | 39 | //FIXME: find a way to override the feed URLs generated by OutputPage::getHeadLinks |
41 | 40 | |
42 | | -function wfNewsExtension() { |
43 | | - global $wgParser; |
44 | | - $wgParser->setHook( "news", "wfNewsTag" ); |
45 | | - $wgParser->setHook( "newsfeed", "wfNewsFeedTag" ); |
46 | | - $wgParser->setHook( "newsfeedlink", "wfNewsFeedLinkTag" ); |
47 | | - wfLoadExtensionMessages( 'NewsExtension' ); |
| 41 | +function wfNewsSetHooks( $parser ) { |
| 42 | + $parser->setHook( 'news', 'wfNewsTag' ); |
| 43 | + $parser->setHook( 'newsfeed', 'wfNewsFeedTag' ); |
| 44 | + $parser->setHook( 'newsfeedlink', 'wfNewsFeedLinkTag' ); |
| 45 | + |
| 46 | + return true; |
48 | 47 | } |
49 | 48 | |
50 | 49 | function wfNewsTag( $templatetext, $argv, $parser ) { |
Index: trunk/extensions/PageCSS/PageCSS.php |
— | — | @@ -11,7 +11,6 @@ |
12 | 12 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
13 | 13 | */ |
14 | 14 | |
15 | | -$wgExtensionFunctions[] = array( 'CssHook', 'setup' ); |
16 | 15 | $wgExtensionCredits['parserhook'][] = array( |
17 | 16 | 'path' => __FILE__, |
18 | 17 | 'name' => 'Page CSS', |
— | — | @@ -20,11 +19,13 @@ |
21 | 20 | 'author' => 'Ævar Arnfjörð Bjarmason' |
22 | 21 | ); |
23 | 22 | |
| 23 | +$wgHooks['ParserFirstCallInit'][] = 'CssHook::setup'; |
| 24 | + |
24 | 25 | class CssHook { |
25 | 26 | |
26 | | - public static function setup() { |
27 | | - global $wgParser; |
28 | | - $wgParser->setHook( 'css', array( 'CssHook', 'parse' ) ); |
| 27 | + public static function setup( $parser ) { |
| 28 | + $parser->setHook( 'css', array( 'CssHook', 'parse' ) ); |
| 29 | + return true; |
29 | 30 | } |
30 | 31 | |
31 | 32 | public static function parse( $content, array $args, Parser $parser ) { |