jenkins-bot has submitted this change and it was merged. Change subject: Add extension.json and empty PHP entry point ......................................................................
Add extension.json and empty PHP entry point Also remove i18n shim. Change-Id: I4c52985dde986ced808e60ee1f36d7e6ce413210 --- D Editcount.i18n.php M Editcount.php A extension.json 3 files changed, 35 insertions(+), 52 deletions(-) Approvals: Paladox: Looks good to me, but someone else must approve Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/Editcount.i18n.php b/Editcount.i18n.php deleted file mode 100644 index 07160e7..0000000 --- a/Editcount.i18n.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * This is a backwards-compatibility shim, generated by: - * https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php - * - * Beginning with MediaWiki 1.23, translation strings are stored in json files, - * and the EXTENSION.i18n.php file only exists to provide compatibility with - * older releases of MediaWiki. For more information about this migration, see: - * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format - * - * This shim maintains compatibility back to MediaWiki 1.17. - */ -$messages = array(); -if ( !function_exists( 'wfJsonI18nShimef56c95ea36d55e2' ) ) { - function wfJsonI18nShimef56c95ea36d55e2( $cache, $code, &$cachedData ) { - $codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] ); - foreach ( $codeSequence as $csCode ) { - $fileName = dirname( __FILE__ ) . "/i18n/$csCode.json"; - if ( is_readable( $fileName ) ) { - $data = FormatJson::decode( file_get_contents( $fileName ), true ); - foreach ( array_keys( $data ) as $key ) { - if ( $key === '' || $key[0] === '@' ) { - unset( $data[$key] ); - } - } - $cachedData['messages'] = array_merge( $data, $cachedData['messages'] ); - } - - $cachedData['deps'][] = new FileDependency( $fileName ); - } - return true; - } - - $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 'wfJsonI18nShimef56c95ea36d55e2'; -} diff --git a/Editcount.php b/Editcount.php index b0cdf19..aed7ad6 100644 --- a/Editcount.php +++ b/Editcount.php @@ -12,21 +12,16 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later */ -if ( !defined( 'MEDIAWIKI' ) ) { - die(); +if ( function_exists( 'wfLoadExtension' ) ) { + wfLoadExtension( 'Editcount' ); + // Keep i18n globals so mergeMessageFileList.php doesn't break + $wgMessagesDirs['Editcount'] = __DIR__ . '/i18n'; + $wgExtensionMessagesFiles['EditcountAlias'] = __DIR__ . '/Editcount.alias.php'; + wfWarn( + 'Deprecated PHP entry point used for Editcount extension. Please use wfLoadExtension instead, ' . + 'see https://www.mediawiki.org/wiki/Extension_registration for more details.' + ); + return; +} else { + die( 'This version of the Editcount extension requires MediaWiki 1.25+' ); } - -$wgExtensionCredits['specialpage'][] = array( - 'path' => __FILE__, - 'name' => 'Editcount', - 'author' => 'Ævar Arnfjörð Bjarmason', - 'descriptionmsg' => 'editcount-desc', - 'url' => 'https://www.mediawiki.org/wiki/Extension:Editcount', -); - -$wgMessagesDirs['Editcount'] = __DIR__ . '/i18n'; -$wgExtensionMessagesFiles['Editcount'] = __DIR__ . '/Editcount.i18n.php'; -$wgExtensionMessagesFiles['EditcountAliases'] = __DIR__ . '/Editcount.alias.php'; -$wgAutoloadClasses['Editcount'] = __DIR__ . '/Editcount_body.php'; -$wgAutoloadClasses['EditcountHTML'] = __DIR__ . '/Editcount_body.php'; -$wgSpecialPages['Editcount'] = 'Editcount'; diff --git a/extension.json b/extension.json new file mode 100644 index 0000000..443fa48 --- /dev/null +++ b/extension.json @@ -0,0 +1,23 @@ +{ + "name": "Editcount", + "author": "Ævar Arnfjörð Bjarmason", + "url": "https://www.mediawiki.org/wiki/Extension:Editcount", + "descriptionmsg": "editcount-desc", + "type": "specialpage", + "SpecialPages": { + "Editcount": "Editcount" + }, + "MessagesDirs": { + "Editcount": [ + "i18n" + ] + }, + "ExtensionMessagesFiles": { + "EditcountAliases": "Editcount.alias.php" + }, + "AutoloadClasses": { + "Editcount": "Editcount_body.php", + "EditcountHTML": "Editcount_body.php" + }, + "manifest_version": 1 +} -- To view, visit https://gerrit.wikimedia.org/r/213317 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4c52985dde986ced808e60ee1f36d7e6ce413210 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/extensions/Editcount Gerrit-Branch: master Gerrit-Owner: Isarra <zhoris...@gmail.com> Gerrit-Reviewer: Jack Phoenix <j...@countervandalism.net> Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com> Gerrit-Reviewer: Paladox <thomasmulhall...@yahoo.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits