Index: trunk/extensions/JIRA/JIRA.php |
— | — | @@ -50,11 +50,11 @@ |
51 | 51 | 'url' => 'http://www.mediawiki.org/wiki/Extension:JIRA', |
52 | 52 | ); |
53 | 53 | |
54 | | -$wgExtensionFunctions[] = 'efJIRASetup'; |
| 54 | +$wgHooks['ParserFirstCallInit'][] = 'efJIRASetHook'; |
55 | 55 | |
56 | | -function efJIRASetup() { |
57 | | -global $wgParser; |
58 | | - $wgParser->setHook( 'jiralist', 'efJIRARender' ); |
| 56 | +function efJIRASetHook( $parser ) { |
| 57 | + $parser->setHook( 'jiralist', 'efJIRARender' ); |
| 58 | + return true; |
59 | 59 | } |
60 | 60 | |
61 | 61 | function efJIRARender( $input, $args, $parser ) { |
Index: trunk/extensions/MathStatFunctions/MathStatFunctions.php |
— | — | @@ -14,8 +14,10 @@ |
15 | 15 | ); |
16 | 16 | |
17 | 17 | $wgExtensionMessagesFiles['MathStatFunctions'] = dirname( __FILE__ ) . '/MathStatFunctions.i18n.php'; |
18 | | -$wgExtensionFunctions[] = 'wfSetupMathStatFunctions'; |
| 18 | +$wgHooks['ParserFirstCallInit'][] = 'wfSetupMathStatFunctions'; |
19 | 19 | |
| 20 | +$wgExtMathStatFunctions = null; |
| 21 | + |
20 | 22 | /** |
21 | 23 | * \brief Exception class identifying that ParserFunctions is not available |
22 | 24 | */ |
— | — | @@ -417,40 +419,42 @@ |
418 | 420 | } |
419 | 421 | } |
420 | 422 | |
421 | | -function wfSetupMathStatFunctions() { |
| 423 | +function wfSetupMathStatFunctions( $parser ) { |
422 | 424 | global $wgParser, $wgExtMathStatFunctions; |
423 | 425 | |
424 | 426 | try { |
425 | | - $wgExtMathStatFunctions = new ExtMathStatFunctions; |
| 427 | + if ( $wgExtMathStatFunctions === null ) { |
| 428 | + $wgExtMathStatFunctions = new ExtMathStatFunctions; |
| 429 | + } |
426 | 430 | } |
427 | 431 | catch ( ParserFunctionsNotFoundException $e ) { |
428 | 432 | throw new FatalError( 'in ' . $e->getFile() . ' on line ' . $e->getLine() . ': ' . $e->getMessage() ); |
429 | 433 | } |
430 | 434 | |
431 | | - $wgParser->setFunctionHook( 'const', array( &$wgExtMathStatFunctions, 'constHook' ) ); |
432 | | - $wgParser->setFunctionHook( 'median', array( &$wgExtMathStatFunctions, 'medianHook' ) ); |
433 | | - $wgParser->setFunctionHook( 'mean', array( &$wgExtMathStatFunctions, 'meanHook' ) ); |
434 | | - $wgParser->setFunctionHook( 'exp', array( &$wgExtMathStatFunctions, 'expHook' ) ); |
435 | | - $wgParser->setFunctionHook( 'log', array( &$wgExtMathStatFunctions, 'logHook' ) ); |
436 | | - $wgParser->setFunctionHook( 'ln', array( &$wgExtMathStatFunctions, 'lnHook' ) ); |
437 | | - $wgParser->setFunctionHook( 'tan', array( &$wgExtMathStatFunctions, 'tanHook' ) ); |
438 | | - $wgParser->setFunctionHook( 'atan', array( &$wgExtMathStatFunctions, 'atanHook' ) ); |
439 | | - $wgParser->setFunctionHook( 'tanh', array( &$wgExtMathStatFunctions, 'tanhHook' ) ); |
440 | | - $wgParser->setFunctionHook( 'atanh', array( &$wgExtMathStatFunctions, 'atanhHook' ) ); |
441 | | - $wgParser->setFunctionHook( 'cot', array( &$wgExtMathStatFunctions, 'cotHook' ) ); |
442 | | - $wgParser->setFunctionHook( 'acot', array( &$wgExtMathStatFunctions, 'acotHook' ) ); |
443 | | - $wgParser->setFunctionHook( 'cos', array( &$wgExtMathStatFunctions, 'cosHook' ) ); |
444 | | - $wgParser->setFunctionHook( 'acos', array( &$wgExtMathStatFunctions, 'acosHook' ) ); |
445 | | - $wgParser->setFunctionHook( 'cosh', array( &$wgExtMathStatFunctions, 'coshHook' ) ); |
446 | | - $wgParser->setFunctionHook( 'acosh', array( &$wgExtMathStatFunctions, 'acoshHook' ) ); |
447 | | - $wgParser->setFunctionHook( 'sec', array( &$wgExtMathStatFunctions, 'secHook' ) ); |
448 | | - $wgParser->setFunctionHook( 'asec', array( &$wgExtMathStatFunctions, 'asecHook' ) ); |
449 | | - $wgParser->setFunctionHook( 'sin', array( &$wgExtMathStatFunctions, 'sinHook' ) ); |
450 | | - $wgParser->setFunctionHook( 'asin', array( &$wgExtMathStatFunctions, 'asinHook' ) ); |
451 | | - $wgParser->setFunctionHook( 'sinh', array( &$wgExtMathStatFunctions, 'sinhHook' ) ); |
452 | | - $wgParser->setFunctionHook( 'asinh', array( &$wgExtMathStatFunctions, 'asinhHook' ) ); |
453 | | - $wgParser->setFunctionHook( 'csc', array( &$wgExtMathStatFunctions, 'cscHook' ) ); |
454 | | - $wgParser->setFunctionHook( 'acsc', array( &$wgExtMathStatFunctions, 'acscHook' ) ); |
| 435 | + $parser->setFunctionHook( 'const', array( &$wgExtMathStatFunctions, 'constHook' ) ); |
| 436 | + $parser->setFunctionHook( 'median', array( &$wgExtMathStatFunctions, 'medianHook' ) ); |
| 437 | + $parser->setFunctionHook( 'mean', array( &$wgExtMathStatFunctions, 'meanHook' ) ); |
| 438 | + $parser->setFunctionHook( 'exp', array( &$wgExtMathStatFunctions, 'expHook' ) ); |
| 439 | + $parser->setFunctionHook( 'log', array( &$wgExtMathStatFunctions, 'logHook' ) ); |
| 440 | + $parser->setFunctionHook( 'ln', array( &$wgExtMathStatFunctions, 'lnHook' ) ); |
| 441 | + $parser->setFunctionHook( 'tan', array( &$wgExtMathStatFunctions, 'tanHook' ) ); |
| 442 | + $parser->setFunctionHook( 'atan', array( &$wgExtMathStatFunctions, 'atanHook' ) ); |
| 443 | + $parser->setFunctionHook( 'tanh', array( &$wgExtMathStatFunctions, 'tanhHook' ) ); |
| 444 | + $parser->setFunctionHook( 'atanh', array( &$wgExtMathStatFunctions, 'atanhHook' ) ); |
| 445 | + $parser->setFunctionHook( 'cot', array( &$wgExtMathStatFunctions, 'cotHook' ) ); |
| 446 | + $parser->setFunctionHook( 'acot', array( &$wgExtMathStatFunctions, 'acotHook' ) ); |
| 447 | + $parser->setFunctionHook( 'cos', array( &$wgExtMathStatFunctions, 'cosHook' ) ); |
| 448 | + $parser->setFunctionHook( 'acos', array( &$wgExtMathStatFunctions, 'acosHook' ) ); |
| 449 | + $parser->setFunctionHook( 'cosh', array( &$wgExtMathStatFunctions, 'coshHook' ) ); |
| 450 | + $parser->setFunctionHook( 'acosh', array( &$wgExtMathStatFunctions, 'acoshHook' ) ); |
| 451 | + $parser->setFunctionHook( 'sec', array( &$wgExtMathStatFunctions, 'secHook' ) ); |
| 452 | + $parser->setFunctionHook( 'asec', array( &$wgExtMathStatFunctions, 'asecHook' ) ); |
| 453 | + $parser->setFunctionHook( 'sin', array( &$wgExtMathStatFunctions, 'sinHook' ) ); |
| 454 | + $parser->setFunctionHook( 'asin', array( &$wgExtMathStatFunctions, 'asinHook' ) ); |
| 455 | + $parser->setFunctionHook( 'sinh', array( &$wgExtMathStatFunctions, 'sinhHook' ) ); |
| 456 | + $parser->setFunctionHook( 'asinh', array( &$wgExtMathStatFunctions, 'asinhHook' ) ); |
| 457 | + $parser->setFunctionHook( 'csc', array( &$wgExtMathStatFunctions, 'cscHook' ) ); |
| 458 | + $parser->setFunctionHook( 'acsc', array( &$wgExtMathStatFunctions, 'acscHook' ) ); |
455 | 459 | |
456 | 460 | return true; |
457 | 461 | } |
Index: trunk/extensions/Memorize/Memorize.php |
— | — | @@ -30,14 +30,13 @@ |
31 | 31 | if( !defined( 'MEDIAWIKI' ) ) |
32 | 32 | die( -1 ); |
33 | 33 | |
34 | | -$wgExtensionFunctions[] = "wfMemorize"; |
| 34 | +$wgHooks['ParserFirstCallInit'][] = 'wfMemorizeSetHook'; |
35 | 35 | $wgHooks['BeforePageDisplay'][] = 'addMemorizeJavascriptAndCSS'; |
36 | 36 | |
37 | 37 | |
38 | | -function wfMemorize() { |
39 | | - global $wgParser; |
40 | | - |
41 | | - $wgParser->setHook( 'memorize', 'renderMemorize' ); |
| 38 | +function wfMemorizeSetHook( $parser ) { |
| 39 | + $parser->setHook( 'memorize', 'renderMemorize' ); |
| 40 | + return true; |
42 | 41 | } |
43 | 42 | |
44 | 43 | function renderMemorize( $input, $argv, &$parser ) { |
Index: trunk/extensions/MiniDonation/MiniDonation.php |
— | — | @@ -8,13 +8,12 @@ |
9 | 9 | 'descriptionmsg' => 'donationform-desc', |
10 | 10 | ); |
11 | 11 | |
12 | | -$wgExtensionFunctions[] = 'wfSetupMiniDonation'; |
| 12 | +$wgHooks['ParserFirstCallInit'][] = 'wfSetupMiniDonation'; |
13 | 13 | $wgExtensionMessagesFiles['MiniDonation'] = dirname(__FILE__) . '/MiniDonation.i18n.php'; |
14 | 14 | |
15 | | -function wfSetupMiniDonation() { |
16 | | - global $wgParser; |
17 | | - |
18 | | - $wgParser->setHook( 'donationform', 'wfMiniDonationHook' ); |
| 15 | +function wfSetupMiniDonation( $parser ) { |
| 16 | + $parser->setHook( 'donationform', 'wfMiniDonationHook' ); |
| 17 | + return true; |
19 | 18 | } |
20 | 19 | |
21 | 20 | function wfMiniDonationHook( $text, $params, $parser ) { |
Index: trunk/extensions/IMStatus/IMStatus.php |
— | — | @@ -53,17 +53,16 @@ |
54 | 54 | //*********** MANDATORY parameters - end |
55 | 55 | |
56 | 56 | //Tag creation |
57 | | -$wgExtensionFunctions[] = "wfIMStatusPCR"; |
58 | | -function wfIMStatusPCR() |
59 | | -{ |
60 | | - global $wgParser; |
61 | | - $wgParser->setHook( "aim", "RenderAIM" ); |
62 | | - $wgParser->setHook( "gtalk", "RenderGTalk" ); |
63 | | - $wgParser->setHook( "icq", "RenderICQ" ); |
64 | | - $wgParser->setHook( "livemessenger", "RenderLiveMessenger" ); |
65 | | - $wgParser->setHook( "skype", "RenderSkype" ); |
66 | | - $wgParser->setHook( "xfire", "RenderXfire" ); |
67 | | - $wgParser->setHook( "yahoo", "RenderYahoo" ); |
| 57 | +$wgHooks['ParserFirstCallInit'][] = 'wfIMStatusPCR'; |
| 58 | +function wfIMStatusPCR( $parser ) { |
| 59 | + $parser->setHook( 'aim', 'RenderAIM' ); |
| 60 | + $parser->setHook( 'gtalk', 'RenderGTalk' ); |
| 61 | + $parser->setHook( 'icq', 'RenderICQ' ); |
| 62 | + $parser->setHook( 'livemessenger', 'RenderLiveMessenger' ); |
| 63 | + $parser->setHook( 'skype', 'RenderSkype' ); |
| 64 | + $parser->setHook( 'xfire', 'RenderXfire' ); |
| 65 | + $parser->setHook( 'yahoo', 'RenderYahoo' ); |
| 66 | + return true; |
68 | 67 | } |
69 | 68 | |
70 | 69 | // FIXME: below should be put in its own class file and use PARSERFIRSTCALLINIT to optimise resource usage |
Index: trunk/extensions/LabeledSectionTransclusion/lsth.php |
— | — | @@ -27,14 +27,13 @@ |
28 | 28 | # Standard initialisation code |
29 | 29 | ## |
30 | 30 | |
31 | | -$wgExtensionFunctions[] = "wfLabeledSectionTransclusionHeading"; |
| 31 | +$wgHooks['ParserFirstCallInit'][] = 'wfLabeledSectionTransclusionHeading'; |
32 | 32 | $wgHooks['LanguageGetMagic'][] = 'wfLabeledSectionTransclusionHeadingMagic'; |
33 | 33 | $wgParserTestFiles[] = dirname( __FILE__ ) . "/lsthParserTests.txt"; |
34 | 34 | |
35 | | -function wfLabeledSectionTransclusionHeading() |
36 | | -{ |
37 | | - global $wgParser; |
38 | | - $wgParser->setFunctionHook( 'lsth', 'wfLstIncludeHeading' ); |
| 35 | +function wfLabeledSectionTransclusionHeading( $parser ) { |
| 36 | + $parser->setFunctionHook( 'lsth', 'wfLstIncludeHeading' ); |
| 37 | + return true; |
39 | 38 | } |
40 | 39 | |
41 | 40 | function wfLabeledSectionTransclusionHeadingMagic( &$magicWords, $langCode ) { |
Index: trunk/extensions/HTMLets/HTMLets.php |
— | — | @@ -51,11 +51,11 @@ |
52 | 52 | |
53 | 53 | $wgHTMLetsDirectory = null; |
54 | 54 | |
55 | | -$wgExtensionFunctions[] = "wfHTMLetsExtension"; |
| 55 | +$wgHooks['ParserFirstCallInit'][] = 'wfHTMLetsSetHook'; |
56 | 56 | |
57 | | -function wfHTMLetsExtension() { |
58 | | - global $wgParser; |
59 | | - $wgParser->setHook( "htmlet", "wfRenderHTMLet" ); |
| 57 | +function wfHTMLetsSetHook( $parser ) { |
| 58 | + $parser->setHook( 'htmlet', 'wfRenderHTMLet' ); |
| 59 | + return true; |
60 | 60 | } |
61 | 61 | |
62 | 62 | # The callback function for converting the input text to HTML output |
Index: trunk/extensions/DynamicPageList/DynamicPageList.php |
— | — | @@ -58,7 +58,7 @@ |
59 | 59 | // we also register the tag <DynamicPageList> because DPL is downward compatible with Extension:Intersection |
60 | 60 | // This means that your LocalSettings.php MUST NO LONGER include Extension:Intersection; |
61 | 61 | |
62 | | -$wgExtensionFunctions[] = array( 'ExtDynamicPageList', 'setupDPL' ); |
| 62 | +$wgHooks['ParserFirstCallInit'][] = 'ExtDynamicPageList::setupDPL'; |
63 | 63 | |
64 | 64 | $wgHooks['LanguageGetMagic'][] = 'ExtDynamicPageList__languageGetMagic'; |
65 | 65 | |
— | — | @@ -80,4 +80,4 @@ |
81 | 81 | ExtDynamicPageList::$DPLVersion = $DPLVersion; |
82 | 82 | |
83 | 83 | // use full functionality by default |
84 | | -ExtDynamicPageList::setFunctionalRichness( 4 ); |
\ No newline at end of file |
| 84 | +ExtDynamicPageList::setFunctionalRichness( 4 ); |
Index: trunk/extensions/DynamicPageList/DPLSetup.php |
— | — | @@ -1173,29 +1173,28 @@ |
1174 | 1174 | self::$functionalRichness = $level; |
1175 | 1175 | } |
1176 | 1176 | |
1177 | | - public static function setupDPL() { |
1178 | | - global $wgParser; |
1179 | | - |
| 1177 | + public static function setupDPL( $parser ) { |
1180 | 1178 | // DPL offers the same functionality as Intersection; so we register the <DynamicPageList> tag |
1181 | 1179 | // in case LabeledSection Extension is not installed we need to remove section markers |
1182 | | - $wgParser->setHook( 'section', array( __CLASS__, 'removeSectionMarkers' ) ); |
1183 | | - $wgParser->setHook( 'DPL', array( __CLASS__, 'dplTag' ) ); |
1184 | | - $wgParser->setHook( 'DynamicPageList', array( __CLASS__, 'intersectionTag' ) ); |
| 1180 | + $parser->setHook( 'section', array( __CLASS__, 'removeSectionMarkers' ) ); |
| 1181 | + $parser->setHook( 'DPL', array( __CLASS__, 'dplTag' ) ); |
| 1182 | + $parser->setHook( 'DynamicPageList', array( __CLASS__, 'intersectionTag' ) ); |
1185 | 1183 | |
1186 | | - $wgParser->setFunctionHook( 'dpl', array( __CLASS__, 'dplParserFunction' ) ); |
1187 | | - $wgParser->setFunctionHook( 'dplnum', array( __CLASS__, 'dplNumParserFunction' ) ); |
1188 | | - $wgParser->setFunctionHook( 'dplchapter', array( __CLASS__, 'dplChapterParserFunction' ) ); |
1189 | | - $wgParser->setFunctionHook( 'dplmatrix', array( __CLASS__, 'dplMatrixParserFunction' ) ); |
| 1184 | + $parser->setFunctionHook( 'dpl', array( __CLASS__, 'dplParserFunction' ) ); |
| 1185 | + $parser->setFunctionHook( 'dplnum', array( __CLASS__, 'dplNumParserFunction' ) ); |
| 1186 | + $parser->setFunctionHook( 'dplchapter', array( __CLASS__, 'dplChapterParserFunction' ) ); |
| 1187 | + $parser->setFunctionHook( 'dplmatrix', array( __CLASS__, 'dplMatrixParserFunction' ) ); |
1190 | 1188 | |
1191 | 1189 | self::commonSetup(); |
| 1190 | + return true; |
1192 | 1191 | } |
1193 | 1192 | |
1194 | 1193 | public static function setupMigration() { |
1195 | 1194 | // DPL offers the same functionality as Intersection under the tag name <Intersection> |
1196 | | - global $wgParser; |
1197 | | - $wgParser->setHook( 'Intersection', array( __CLASS__, 'intersectionTag' ) ); |
| 1195 | + $parser->setHook( 'Intersection', array( __CLASS__, 'intersectionTag' ) ); |
1198 | 1196 | |
1199 | 1197 | self::commonSetup(); |
| 1198 | + return true; |
1200 | 1199 | } |
1201 | 1200 | |
1202 | 1201 | private static function commonSetup() { |
Index: trunk/extensions/DynamicPageList/DynamicPageListMigration.php |
— | — | @@ -39,7 +39,7 @@ |
40 | 40 | // A call to ExtDynamicPageList::setFunctionalRichness(n) with n>0 will provide additional functionality |
41 | 41 | // for the <Intersection> tag; so you can try out additional features without bothering anyone. |
42 | 42 | |
43 | | -$wgExtensionFunctions[] = array( 'ExtDynamicPageList', 'setupMigration' ); |
| 43 | +$wgHooks['ParserFirstCallIntit'][] = 'ExtDynamicPageList::setupMigration'; |
44 | 44 | |
45 | 45 | $wgHooks['LanguageGetMagic'][] = 'ExtDynamicPageList__languageGetMagic'; |
46 | 46 | |