[MediaWiki-commits] [Gerrit] Convert MobileApp extension to use extension.json - change (mediawiki...MobileApp)
Ananay has uploaded a new change for review. https://gerrit.wikimedia.org/r/262740 Change subject: Convert MobileApp extension to use extension.json .. Convert MobileApp extension to use extension.json Bug: T88056 Change-Id: Ife8101919ebcb168addfb3b43885a696751b7391 --- M MobileApp.php A extension.json 2 files changed, 84 insertions(+), 67 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileApp refs/changes/40/262740/1 diff --git a/MobileApp.php b/MobileApp.php index 978fc94..58c31f0 100644 --- a/MobileApp.php +++ b/MobileApp.php @@ -8,72 +8,11 @@ * @copyright © 2014 Yuvi Panda * @licence GNU General Public Licence 2.0 or later */ -if ( !defined( 'MEDIAWIKI' ) ) { - echo( "This is an extension to the MediaWiki package and cannot be run standalone.\n" ); - die( -1 ); + +if ( function_exists( 'wfLoadExtension' ) ) { + wfLoadExtension( 'MobileApp' ); + $wgMessagesDirs['MobileApp'] = __DIR__ . '/i18n'; +} else { + die( 'This version of the MobileApp extension requires MediaWiki 1.25+' ); } -$localBasePath = __DIR__; -$remoteExtPath = 'MobileApp'; - -// Extension credits that will show up on Special:Version -$wgExtensionCredits['other'][] = array( - 'path' => __FILE__, - 'name' => 'MobileApp', - 'author' => array( 'Yuvi Panda' ), - 'url' => 'https://www.mediawiki.org/wiki/Extension:MobileApp', - 'descriptionmsg' => 'mobileapp-desc', - 'license-name' => 'GPL-2.0+', -); - -$wgMessagesDirs['MobileApp'] = __DIR__ . "/i18n"; - -$wgAutoloadClasses['MobileAppResourceLoaderModule'] = __DIR__ . '/MobileAppResourceLoaderModule.php'; -$wgAutoloadClasses['MobileAppHooks'] = __DIR__ . '/MobileApp.hooks.php'; - -$wgHooks['ListDefinedTags'][] = 'MobileAppHooks::onListDefinedTags'; -$wgHooks['ChangeTagsListActive'][] = 'MobileAppHooks::onListDefinedTags'; -$wgHooks['RecentChange_save'][] = 'MobileAppHooks::onRecentChange_save'; - -$wgResourceModules['mobile.app.site'] = array( 'class' => 'MobileAppResourceLoaderModule' ); - -$wgCommonMobileAppModuleDef = array( - 'localBasePath' => $localBasePath, - 'remoteExtPath' => $remoteExtPath -); - -$wgResourceModules['mobile.app.pagestyles.android'] = array( - 'styles' => array( - 'styles/android.less', - 'styles/editlinks.less', - 'styles/issues.less', - 'styles/disambig.less', - 'styles/tables.less', - 'styles/ipa.less', - 'styles/enwiki.less', - 'styles/parsoid.less', - 'styles/widenImages.less' - ) -) + $wgCommonMobileAppModuleDef; - -$wgResourceModules['mobile.app.pagestyles.android.night'] = array( - 'styles' => array( - 'styles/night.less', - ) -) + $wgCommonMobileAppModuleDef; - -$wgResourceModules['mobile.app.pagestyles.ios'] = array( - 'styles' => array( - 'styles/editlinks.less', - 'styles/enwiki.less', - 'styles/issues.less', - 'styles/disambig.less' - ) -) + $wgCommonMobileAppModuleDef; - -$wgResourceModules['mobile.app.preview'] = array( - 'styles' => array( - 'styles/preview.less', - 'styles/enwiki.less' - ) -) + $wgCommonMobileAppModuleDef; diff --git a/extension.json b/extension.json new file mode 100644 index 000..42ef58c --- /dev/null +++ b/extension.json @@ -0,0 +1,78 @@ +{ + "name": "MobileApp", + "author": [ + "Yuvi Panda" + ], + "url": "https://www.mediawiki.org/wiki/Extension:MobileApp;, + "descriptionmsg": "mobileapp-desc", + "license-name": "GPL-2.0+", + "type": "other", + "MessagesDirs": { + "MobileApp": [ + "i18n" + ] + }, + "AutoloadClasses": { + "MobileAppResourceLoaderModule": "MobileAppResourceLoaderModule.php", + "MobileAppHooks": "MobileApp.hooks.php" + }, + "ResourceModules": { + "mobile.app.site": { + "class": "MobileAppResourceLoaderModule" + }, + "mobile.app.pagestyles.android": { + "styles": [ + "styles/android.less", + "styles/editlinks.less", + "styles/issues.less", + "styles/disambig.less", + "styles/tables.less", + "styles/ipa.less", +
[MediaWiki-commits] [Gerrit] Convert MobileApp extension to use extension.json - change (mediawiki...MobileApp)
jenkins-bot has submitted this change and it was merged. Change subject: Convert MobileApp extension to use extension.json .. Convert MobileApp extension to use extension.json Bug: T88056 Change-Id: Ife8101919ebcb168addfb3b43885a696751b7391 --- M MobileApp.php A extension.json 2 files changed, 83 insertions(+), 67 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/MobileApp.php b/MobileApp.php index 978fc94..5499c86 100644 --- a/MobileApp.php +++ b/MobileApp.php @@ -8,72 +8,16 @@ * @copyright © 2014 Yuvi Panda * @licence GNU General Public Licence 2.0 or later */ -if ( !defined( 'MEDIAWIKI' ) ) { - echo( "This is an extension to the MediaWiki package and cannot be run standalone.\n" ); - die( -1 ); + +if ( function_exists( 'wfLoadExtension' ) ) { + wfLoadExtension( 'MobileApp' ); + // Keep i18n globals so mergeMessageFileList.php doesn't break + $wgMessagesDirs['MobileApp'] = __DIR__ . '/i18n'; + /* wfWarn( + 'Deprecated PHP entry point used for Gadgets extension. Please use wfLoadExtension instead, ' . + 'see https://www.mediawiki.org/wiki/Extension_registration for more details.' + ); */ +} else { + die( 'This version of the MobileApp extension requires MediaWiki 1.25+' ); } -$localBasePath = __DIR__; -$remoteExtPath = 'MobileApp'; - -// Extension credits that will show up on Special:Version -$wgExtensionCredits['other'][] = array( - 'path' => __FILE__, - 'name' => 'MobileApp', - 'author' => array( 'Yuvi Panda' ), - 'url' => 'https://www.mediawiki.org/wiki/Extension:MobileApp', - 'descriptionmsg' => 'mobileapp-desc', - 'license-name' => 'GPL-2.0+', -); - -$wgMessagesDirs['MobileApp'] = __DIR__ . "/i18n"; - -$wgAutoloadClasses['MobileAppResourceLoaderModule'] = __DIR__ . '/MobileAppResourceLoaderModule.php'; -$wgAutoloadClasses['MobileAppHooks'] = __DIR__ . '/MobileApp.hooks.php'; - -$wgHooks['ListDefinedTags'][] = 'MobileAppHooks::onListDefinedTags'; -$wgHooks['ChangeTagsListActive'][] = 'MobileAppHooks::onListDefinedTags'; -$wgHooks['RecentChange_save'][] = 'MobileAppHooks::onRecentChange_save'; - -$wgResourceModules['mobile.app.site'] = array( 'class' => 'MobileAppResourceLoaderModule' ); - -$wgCommonMobileAppModuleDef = array( - 'localBasePath' => $localBasePath, - 'remoteExtPath' => $remoteExtPath -); - -$wgResourceModules['mobile.app.pagestyles.android'] = array( - 'styles' => array( - 'styles/android.less', - 'styles/editlinks.less', - 'styles/issues.less', - 'styles/disambig.less', - 'styles/tables.less', - 'styles/ipa.less', - 'styles/enwiki.less', - 'styles/parsoid.less', - 'styles/widenImages.less' - ) -) + $wgCommonMobileAppModuleDef; - -$wgResourceModules['mobile.app.pagestyles.android.night'] = array( - 'styles' => array( - 'styles/night.less', - ) -) + $wgCommonMobileAppModuleDef; - -$wgResourceModules['mobile.app.pagestyles.ios'] = array( - 'styles' => array( - 'styles/editlinks.less', - 'styles/enwiki.less', - 'styles/issues.less', - 'styles/disambig.less' - ) -) + $wgCommonMobileAppModuleDef; - -$wgResourceModules['mobile.app.preview'] = array( - 'styles' => array( - 'styles/preview.less', - 'styles/enwiki.less' - ) -) + $wgCommonMobileAppModuleDef; diff --git a/extension.json b/extension.json new file mode 100644 index 000..e0d5697 --- /dev/null +++ b/extension.json @@ -0,0 +1,72 @@ +{ + "name": "MobileApp", + "author": [ + "Yuvi Panda" + ], + "url": "https://www.mediawiki.org/wiki/Extension:MobileApp;, + "descriptionmsg": "mobileapp-desc", + "license-name": "GPL-2.0+", + "type": "other", + "MessagesDirs": { + "MobileApp": [ + "i18n" + ] + }, + "AutoloadClasses": { + "MobileAppResourceLoaderModule": "MobileAppResourceLoaderModule.php", + "MobileAppHooks": "MobileApp.hooks.php" + }, + "ResourceModules": { + "mobile.app.site": { + "class": "MobileAppResourceLoaderModule" + }, + "mobile.app.pagestyles.android": { + "styles": [ + "styles/android.less", +