[MediaWiki-commits] [Gerrit] mediawiki...Lingo[master]: Use GetDoubleUnderscoreIDs hook
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/325525 ) Change subject: Use GetDoubleUnderscoreIDs hook .. Use GetDoubleUnderscoreIDs hook This avoids messing with the MagicWord class directly, and better supports lazy-loading. Change-Id: I2d069f5298599c8d695a54e578d58e67e25b57f6 --- M extension.json M src/Lingo.php 2 files changed, 11 insertions(+), 3 deletions(-) Approvals: Foxtrott: Looks good to me, approved jenkins-bot: Verified diff --git a/extension.json b/extension.json index e4c0753..e979b51 100644 --- a/extension.json +++ b/extension.json @@ -60,6 +60,9 @@ "ExtensionMessagesFiles": { "LingoMagic": "src/Lingo.i18n.magic.php" }, + "Hooks": { + "GetDoubleUnderscoreIDs": "Lingo\\Lingo::onGetDoubleUnderscoreIDs" + }, "AutoloadClasses": { "Lingo\\Lingo": "/src/Lingo.php", "Lingo\\LingoParser": "/src/LingoParser.php", diff --git a/src/Lingo.php b/src/Lingo.php index 9ff89ee..a4e10d5 100644 --- a/src/Lingo.php +++ b/src/Lingo.php @@ -64,8 +64,6 @@ return true; } ); - MagicWord::$mDoubleUnderscoreIDs[] = 'noglossary'; - foreach ( $GLOBALS[ 'wgExtensionCredits' ][ 'parserhook' ] as $index => $description ) { if ( $GLOBALS[ 'wgExtensionCredits' ][ 'parserhook' ][ $index ][ 'name' ] === 'Lingo' ) { @@ -80,5 +78,12 @@ }; } - + /** +* Hook: GetDoubleUnderscoreIDs +* +* @param array $doubleUnderscoreIDs +*/ + public static function onGetDoubleUnderscoreIDs( array &$doubleUnderscoreIDs ) { + $doubleUnderscoreIDs[] = 'noglossary'; + } } -- To view, visit https://gerrit.wikimedia.org/r/325525 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2d069f5298599c8d695a54e578d58e67e25b57f6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Lingo Gerrit-Branch: master Gerrit-Owner: LegoktmGerrit-Reviewer: Foxtrott Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Lingo[master]: Use GetDoubleUnderscoreIDs hook
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/325525 Change subject: Use GetDoubleUnderscoreIDs hook .. Use GetDoubleUnderscoreIDs hook This avoids messing with the MagicWord class directly, and better supports lazy-loading. Change-Id: I2d069f5298599c8d695a54e578d58e67e25b57f6 --- M extension.json M src/Lingo.php 2 files changed, 11 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lingo refs/changes/25/325525/1 diff --git a/extension.json b/extension.json index e4c0753..e979b51 100644 --- a/extension.json +++ b/extension.json @@ -60,6 +60,9 @@ "ExtensionMessagesFiles": { "LingoMagic": "src/Lingo.i18n.magic.php" }, + "Hooks": { + "GetDoubleUnderscoreIDs": "Lingo\\Lingo::onGetDoubleUnderscoreIDs" + }, "AutoloadClasses": { "Lingo\\Lingo": "/src/Lingo.php", "Lingo\\LingoParser": "/src/LingoParser.php", diff --git a/src/Lingo.php b/src/Lingo.php index 9ff89ee..a4e10d5 100644 --- a/src/Lingo.php +++ b/src/Lingo.php @@ -64,8 +64,6 @@ return true; } ); - MagicWord::$mDoubleUnderscoreIDs[] = 'noglossary'; - foreach ( $GLOBALS[ 'wgExtensionCredits' ][ 'parserhook' ] as $index => $description ) { if ( $GLOBALS[ 'wgExtensionCredits' ][ 'parserhook' ][ $index ][ 'name' ] === 'Lingo' ) { @@ -80,5 +78,12 @@ }; } - + /** +* Hook: GetDoubleUnderscoreIDs +* +* @param array $doubleUnderscoreIDs +*/ + public static function onGetDoubleUnderscoreIDs( array &$doubleUnderscoreIDs ) { + $doubleUnderscoreIDs[] = 'noglossary'; + } } -- To view, visit https://gerrit.wikimedia.org/r/325525 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2d069f5298599c8d695a54e578d58e67e25b57f6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Lingo Gerrit-Branch: master Gerrit-Owner: Legoktm___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits