From 317cbcb3464d2dba7c43ded07c56476a117df287 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Fri, 4 Sep 2009 22:22:12 +0000 Subject: [PATCH] Nuking fallback code for MW < 1.12 in most extensions (there's like 5 or 6 left I haven't done). Couple of points: * 1.11 and below aren't supported anymore, so we don't need to be maintaining back-compat code for it anymore. This is why we branch extensions * The vast majority of these were using $wgParser. This defeats the purpose of ParserFirstCallInit...allowing you to use parsers other than $wgParser. All these extensions now work in any instance of the Parser, not just $wgParser --- ContributionScores.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/ContributionScores.php b/ContributionScores.php index 93ad076..dac29ce 100644 --- a/ContributionScores.php +++ b/ContributionScores.php @@ -42,11 +42,7 @@ if( version_compare( $wgVersion, '1.13', '>=' ) ) { $wgHooks['LanguageGetMagic'][] = 'efContributionScores_LanguageGetMagic'; -if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) ) { - $wgHooks['ParserFirstCallInit'][] = 'efContributionScores_Setup'; -} else { - $wgExtensionFunctions[] = 'efContributionScores_Setup'; -} +$wgHooks['ParserFirstCallInit'][] = 'efContributionScores_Setup'; ///Message Cache population for versions that did not support $wgExtensionFunctions function efContributionScores_AddMessages() { @@ -60,10 +56,8 @@ function efContributionScores_AddMessages() { return true; } -function efContributionScores_Setup() { - global $wgParser; - - $wgParser->setFunctionHook( 'cscore', 'efContributionScores_Render' ); +function efContributionScores_Setup( &$parser ) { + $parser->setFunctionHook( 'cscore', 'efContributionScores_Render' ); return true; }