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 9254b99dd8
commit f1611c78bf
2 changed files with 3 additions and 11 deletions

View file

@ -12,11 +12,9 @@ class InputBoxHooks {
/* Functions */
// Initialization
public static function register() {
global $wgParser;
public static function register( &$parser ) {
// Register the hook with the parser
$wgParser->setHook( 'inputbox', array( 'InputBoxHooks', 'render' ) );
$parser->setHook( 'inputbox', array( 'InputBoxHooks', 'render' ) );
// Continue
return true;

View file

@ -49,10 +49,4 @@ $wgAutoloadClasses['InputBoxHooks'] = $dir . 'InputBox.hooks.php';
$wgAutoloadClasses['InputBox'] = $dir . 'InputBox.classes.php';
// Register parser hook
if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) ) {
// Modern
$wgHooks['ParserFirstCallInit'][] = 'InputBoxHooks::register';
} else {
// Legacy
$wgExtensionFunctions[] = array( 'InputBoxHooks', 'register' );
}