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
This commit is contained in:
parent
0c07eb6623
commit
317cbcb346
1 changed files with 3 additions and 9 deletions
|
@ -42,11 +42,7 @@ if( version_compare( $wgVersion, '1.13', '>=' ) ) {
|
||||||
|
|
||||||
$wgHooks['LanguageGetMagic'][] = 'efContributionScores_LanguageGetMagic';
|
$wgHooks['LanguageGetMagic'][] = 'efContributionScores_LanguageGetMagic';
|
||||||
|
|
||||||
if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) ) {
|
|
||||||
$wgHooks['ParserFirstCallInit'][] = 'efContributionScores_Setup';
|
$wgHooks['ParserFirstCallInit'][] = 'efContributionScores_Setup';
|
||||||
} else {
|
|
||||||
$wgExtensionFunctions[] = 'efContributionScores_Setup';
|
|
||||||
}
|
|
||||||
|
|
||||||
///Message Cache population for versions that did not support $wgExtensionFunctions
|
///Message Cache population for versions that did not support $wgExtensionFunctions
|
||||||
function efContributionScores_AddMessages() {
|
function efContributionScores_AddMessages() {
|
||||||
|
@ -60,10 +56,8 @@ function efContributionScores_AddMessages() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function efContributionScores_Setup() {
|
function efContributionScores_Setup( &$parser ) {
|
||||||
global $wgParser;
|
$parser->setFunctionHook( 'cscore', 'efContributionScores_Render' );
|
||||||
|
|
||||||
$wgParser->setFunctionHook( 'cscore', 'efContributionScores_Render' );
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue