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:
Chad Horohoe 2009-09-04 22:22:12 +00:00
parent 009be65358
commit 1db4e16297

View file

@ -154,7 +154,7 @@ $wgAjaxExportList[] = 'efCategoryTreeAjaxWrapper';
function efCategoryTree() {
global $wgUseAjax, $wgHooks, $wgOut;
global $wgCategoryTreeDefaultOptions, $wgCategoryTreeDefaultMode, $wgCategoryTreeOmitNamespace;
global $wgCategoryTreeCategoryPageOptions, $wgCategoryTreeCategoryPageMode;
global $wgCategoryTreeCategoryPageOptions, $wgCategoryTreeCategoryPageMode, $wgCategoryTreeAllowTag;
global $wgCategoryTreeSidebarRoot, $wgCategoryTreeForceHeaders, $wgCategoryTreeHijackPageCategories;
# Abort if AJAX is not enabled
@ -174,10 +174,8 @@ function efCategoryTree() {
$wgHooks['SkinJoinCategoryLinks'][] = 'efCategoryTreeSkinJoinCategoryLinks';
}
if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) ) {
if( $wgCategoryTreeAllowTag ) {
$wgHooks['ParserFirstCallInit'][] = 'efCategoryTreeSetHooks';
} else {
efCategoryTreeSetHooks();
}
if ( !isset( $wgCategoryTreeDefaultOptions['mode'] ) || is_null( $wgCategoryTreeDefaultOptions['mode'] ) ) {
@ -200,12 +198,9 @@ function efCategoryTree() {
}
}
function efCategoryTreeSetHooks() {
global $wgParser, $wgCategoryTreeAllowTag;
if ( $wgCategoryTreeAllowTag ) {
$wgParser->setHook( 'categorytree' , 'efCategoryTreeParserHook' );
$wgParser->setFunctionHook( 'categorytree' , 'efCategoryTreeParserFunction' );
}
function efCategoryTreeSetHooks( &$parser ) {
$parser->setHook( 'categorytree' , 'efCategoryTreeParserHook' );
$parser->setFunctionHook( 'categorytree' , 'efCategoryTreeParserFunction' );
return true;
}