diff options
author | 2020-12-03 21:51:10 -0500 | |
---|---|---|
committer | 2020-12-03 21:51:10 -0500 | |
commit | 6d90a583c8467ce76c3be898a4280c07ae1f71c6 (patch) | |
tree | 5904efdb212a6eed751521606c215ae4409b1923 | |
parent | Echo: Fix necessary class so it doesn't look wonky (diff) | |
download | extensions-6d90a583c8467ce76c3be898a4280c07ae1f71c6.tar.gz extensions-6d90a583c8467ce76c3be898a4280c07ae1f71c6.tar.bz2 extensions-6d90a583c8467ce76c3be898a4280c07ae1f71c6.zip |
GentooToolbox: Implement new parser interface
New in 1.35. This will the way it will be done in the future.
Specifying a class which implements a Hook interface
Signed-off-by: Brian Evans <grknight@gentoo.org>
-rw-r--r-- | GentooToolbox/extension.json | 6 | ||||
-rw-r--r-- | GentooToolbox/localizedmsg/LocalizedMsg.php | 6 |
2 files changed, 5 insertions, 7 deletions
diff --git a/GentooToolbox/extension.json b/GentooToolbox/extension.json index ace0657c..70f4d3f3 100644 --- a/GentooToolbox/extension.json +++ b/GentooToolbox/extension.json @@ -1,12 +1,12 @@ { "name": "Gentoo Toolbox", - "version": "0.0.1", + "version": "0.0.2", "author": [ "Alex Legler" ], "url": "https://wiki.gentoo.org/", "license-name": "GPL-2.0", "type": "semantic", "requires": { - "MediaWiki": ">= 1.25.0" + "MediaWiki": ">= 1.35.0" }, "ExtensionMessagesFiles": { "GTBX_TranslationProperties": "properties/TranslationProperties.i18n.php" @@ -22,7 +22,7 @@ "Hooks": { "smwInitProperties": "GTBXTranslationProperties::setupProperties", "SMWStore::updateDataBefore": "GTBXTranslationProperties::updateDataBefore", - "ParserFirstCallInit": "GTBXLocalizedMsg::SetUpLocalizedMsgParserFunction" + "ParserFirstCallInit": "GTBXLocalizedMsg" }, "manifest_version": 1 } diff --git a/GentooToolbox/localizedmsg/LocalizedMsg.php b/GentooToolbox/localizedmsg/LocalizedMsg.php index 13d659fe..b3627515 100644 --- a/GentooToolbox/localizedmsg/LocalizedMsg.php +++ b/GentooToolbox/localizedmsg/LocalizedMsg.php @@ -1,9 +1,8 @@ <?php -class GTBXLocalizedMsg { - public static function SetUpLocalizedMsgParserFunction( &$parser ) { +class GTBXLocalizedMsg implements MediaWiki\Hook\ParserFirstCallInitHook { + public function onParserFirstCallInit ( $parser ) { $parser->setFunctionHook( 'msg', 'GTBXLocalizedMsg::LocalizedMsgParserFunction' ); - return true; } @@ -21,4 +20,3 @@ class GTBXLocalizedMsg { return wfMessage( $message )->inLanguage( $language_code )->escaped(); } } -?>
\ No newline at end of file |