mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/InputBox
synced 2024-11-23 22:54:02 +00:00
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
9254b99dd8
commit
f1611c78bf
|
@ -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;
|
||||
|
|
|
@ -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' );
|
||||
}
|
||||
$wgHooks['ParserFirstCallInit'][] = 'InputBoxHooks::register';
|
||||
|
|
Loading…
Reference in a new issue