r80441 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80440‎ | r80441 | r80442 >
Date:09:06, 17 January 2011
Author:ialex
Status:deferred
Tags:
Comment:
Use $wgExtensionMessagesFiles and ParserFirstCallInit hook instead of respectively pre-1.11 and pre-1.12 way of doing them
Modified paths:
  • /trunk/extensions/phpbbData/phpbbData.php (modified) (history)

Diff [purge]

Index: trunk/extensions/phpbbData/phpbbData.php
@@ -21,24 +21,18 @@
2222 'url' => 'http://www.mediawiki.org/wiki/Extension:phpbbData',
2323 );
2424
25 -$wgExtensionFunctions[] = 'efPhpbbData_Setup';
 25+$wgHooks['ParserFirstCallInit'][] = 'efPhpbbData_ParserFirstCallInit';
2626 $wgHooks['LanguageGetMagic' ][] = 'efPhpbbData_LanguageGetMagic';
2727 $wgHooks['BeforePageDisplay'][] = 'efPhpbbData_BeforePageDisplay';
2828
29 -function efPhpbbData_Setup() {
30 - global $wgParser, $wgMessageCache;
31 -
32 - #Add Messages
33 - require( dirname( __FILE__ ) . '/phpbbData.i18n.php' );
34 - foreach( $messages as $key => $value ) {
35 - $wgMessageCache->addMessages( $messages[$key], $key );
36 - }
37 -
38 - # Set a function hook associating the "example" magic word with our function
39 - $wgParser->setFunctionHook( 'phpbb', 'efPhpbbData_RenderList' );
40 - $wgParser->setFunctionHook( 'phpbblink', 'efPhpbbData_RenderLink' );
41 -
42 - return true;
 29+$wgExtensionMessagesFiles['phpbbData'] = dirname( __FILE__ ) . '/phpbbData.i18n.php';
 30+
 31+function efPhpbbData_ParserFirstCallInit( $parser ) {
 32+ # Set a function hook associating the "example" magic word with our function
 33+ $parser->setFunctionHook( 'phpbb', 'efPhpbbData_RenderList' );
 34+ $parser->setFunctionHook( 'phpbblink', 'efPhpbbData_RenderLink' );
 35+
 36+ return true;
4337 }
4438
4539 function efPhpbbData_BeforePageDisplay(&$out) {

Status & tagging log