jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/367651 )
Change subject: Remove I18n php shim and bump version ...................................................................... Remove I18n php shim and bump version Also * Tidy main file * Extend file documentation * Update author's array Note: This is breaking for MW 1.22.x and earlier. Bug:T168353 Change-Id: Iaaf797499ce424bf97dbd614b2b07f9f62f5590a --- D NoTitle.i18n.php M NoTitle.php 2 files changed, 32 insertions(+), 55 deletions(-) Approvals: Umherirrender: Looks good to me, approved jenkins-bot: Verified diff --git a/NoTitle.i18n.php b/NoTitle.i18n.php deleted file mode 100644 index b3252fa..0000000 --- a/NoTitle.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( 'wfJsonI18nShim53649952fe4c3ac1' ) ) { - function wfJsonI18nShim53649952fe4c3ac1( $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'][] = 'wfJsonI18nShim53649952fe4c3ac1'; -} diff --git a/NoTitle.php b/NoTitle.php index 6d62fd3..fb1840e 100644 --- a/NoTitle.php +++ b/NoTitle.php @@ -1,37 +1,49 @@ <?php /* - * NoTitle - * Adds a magic word that hides the main title heading in a page + * NoTitle extension to MediaWiki + * + * Adds a magic word that hides the main title heading in a page + * + * @link https://www.mediawiki.org/wiki/Extension:NoTitle Documentation + * @link https://www.mediawiki.org/wiki/Extension_talk:NoTitle Support + * @link https://phabricator.wikimedia.org/diffusion/ENOT/ Source code * * @file NoTitle.php + * @ingroup Extensions + * @package MediaWiki + * * @author Carlo Cabanilla * @author Tony Boyles + * + * @license https://www.gnu.org/licenses/gpl-3.0.en.html GNU General Public License 3.0 or later */ +// Ensure that the script cannot be executed outside of MediaWiki. if ( !defined( 'MEDIAWIKI' ) ) { - die( 'This file is an extension to the <a href="https://www.mediawiki.org/">MediaWiki platform</a> and cannot be used standalone.' ); + die( 'This file is an extension to MediaWiki and cannot be used standalone.' ); } -# File inclusion and registration: -$wgAutoloadClasses['NoTitle'] = __DIR__ . '/NoTitle.body.php'; -$wgMessagesDirs['NoTitle'] = __DIR__ . '/i18n'; -$wgExtensionMessagesFiles['NoTitle'] = __DIR__ . '/NoTitle.i18n.php'; -$wgExtensionMessagesFiles['NoTitleMagic'] = __DIR__ . '/NoTitle.i18n.magic.php'; - -# Hook our events: -$wgHooks['ParserBeforeTidy'][] = 'NoTitle::killTitle'; - -# Extension Registration: +// Display extension properties on MediaWiki. $wgExtensionCredits['parserhook'][] = array( - 'path' => __FILE__, - 'name' => 'NoTitle', - 'version' => '0.2.0', - 'author' => array( + 'path' => __FILE__, + 'name' => 'NoTitle', + 'version' => '0.3.0', + 'author' => array( 'Carlo Cabanilla', - '[http://milcord.com/ Tony Boyles, Milcord LLC]' + 'Tony Boyles', + '...' ), - 'url' => 'https://www.mediawiki.org/wiki/Extension:NoTitle', + 'url' => 'https://www.mediawiki.org/wiki/Extension:NoTitle', 'descriptionmsg' => 'notitle-desc', - 'license-name' => 'GPL-3.0+' + 'license-name' => 'GPL-3.0+' ); +// Load extension classes. +$wgAutoloadClasses['NoTitle'] = __DIR__ . '/NoTitle.body.php'; + +// Register extension messages and other localisation. +$wgMessagesDirs['NoTitle'] = __DIR__ . '/i18n'; +$wgExtensionMessagesFiles['NoTitleMagic'] = __DIR__ . '/NoTitle.i18n.magic.php'; + +// Register extension hooks. +$wgHooks['ParserBeforeTidy'][] = 'NoTitle::killTitle'; -- To view, visit https://gerrit.wikimedia.org/r/367651 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iaaf797499ce424bf97dbd614b2b07f9f62f5590a Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/NoTitle Gerrit-Branch: master Gerrit-Owner: Kghbln <[email protected]> Gerrit-Reviewer: Reedy <[email protected]> Gerrit-Reviewer: Siebrand <[email protected]> Gerrit-Reviewer: Umherirrender <[email protected]> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
