Jayprakash12345 has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/405264 )
Change subject: Convert PageLanguage to use extension registration ...................................................................... Convert PageLanguage to use extension registration Bug: T185301 Change-Id: I0d1b56645179b981797cbd22cddd219fb422a86f --- M PageLanguage.php A extension.json 2 files changed, 38 insertions(+), 21 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageLanguage refs/changes/64/405264/2 diff --git a/PageLanguage.php b/PageLanguage.php index 539326d..a67e610 100644 --- a/PageLanguage.php +++ b/PageLanguage.php @@ -1,23 +1,15 @@ <?php -if ( !defined( 'MEDIAWIKI' ) ) { - die( 'Not a valid entry point' ); -} - -$wgExtensionCredits['other'][] = array( - 'path' => __FILE__, - 'name' => 'Page Language', - 'author' => array( 'Liangent' ), - 'url' => 'https://www.mediawiki.org/wiki/Extension:PageLanguage', - 'descriptionmsg' => 'pagelanguage-desc', -); - -$dir = __DIR__; - -$wgAutoloadClasses['PageLanguage'] = "$dir/PageLanguage.body.php"; - -$wgMessagesDirs['PageLanguage'] = __DIR__ . '/i18n'; -$wgExtensionMessagesFiles['PageLanguageMagic'] = "$dir/PageLanguage.magic.php"; - -$wgHooks['PageContentLanguage'][] = 'PageLanguage::onPageContentLanguage'; -$wgHooks['ParserFirstCallInit'][] = 'PageLanguage::onParserFirstCallInit'; + if ( function_exists( 'wfLoadExtension' ) ) { + wfLoadExtension( 'PageLanguage' ); + // Keep i18n globals so mergeMessageFileList.php doesn't break + $wgMessagesDirs['PageLanguage'] = __DIR__ . '/i18n'; + wfWarn( + 'Deprecated PHP entry point used for the PageLanguage extension. ' . + 'Please use wfLoadExtension instead, ' . + 'see https://www.mediawiki.org/wiki/Extension_registration for more details.' + ); + return; +} else { + die( 'This version of the PageLanguage extension requires MediaWiki 1.29+' ); +} \ No newline at end of file diff --git a/extension.json b/extension.json new file mode 100644 index 0000000..fcdd468 --- /dev/null +++ b/extension.json @@ -0,0 +1,25 @@ +{ + "name": "Page Language", + "author": [ + "Liangent" + ], + "url": "https://www.mediawiki.org/wiki/Extension:PageLanguage", + "descriptionmsg": "pagelanguage-desc", + "type": "other", + "MessagesDirs": { + "PageLanguage": [ + "i18n" + ] + }, + "ExtensionMessagesFiles": { + "PageLanguageMagic": "PageLanguage.magic.php" + }, + "AutoloadClasses": { + "PageLanguage": "PageLanguage.body.php" + }, + "Hooks": { + "PageContentLanguage": "PageLanguage::onPageContentLanguage", + "ParserFirstCallInit": "PageLanguage::onParserFirstCallInit" + }, + "manifest_version": 2 +} -- To view, visit https://gerrit.wikimedia.org/r/405264 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0d1b56645179b981797cbd22cddd219fb422a86f Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/PageLanguage Gerrit-Branch: master Gerrit-Owner: Jayprakash12345 <0freerunn...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits