jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/367861 )
Change subject: Remove I18n php shim ...................................................................... Remove I18n php shim Also consistently use __DIR__ Note: This is breaking for MW 1.22.x and earlier. Bug:T168353 Change-Id: I47531fb5390c1794cec236a24c74e56b22c9840d --- D Special404.i18n.php M Special404.php 2 files changed, 11 insertions(+), 44 deletions(-) Approvals: Umherirrender: Looks good to me, approved jenkins-bot: Verified diff --git a/Special404.i18n.php b/Special404.i18n.php deleted file mode 100644 index 56812f7..0000000 --- a/Special404.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( 'wfJsonI18nShima751b65fda5f7636' ) ) { - function wfJsonI18nShima751b65fda5f7636( $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'][] = 'wfJsonI18nShima751b65fda5f7636'; -} diff --git a/Special404.php b/Special404.php index aa27a64..4093780 100644 --- a/Special404.php +++ b/Special404.php @@ -5,16 +5,16 @@ * @file * @ingroup Extensions * @author Daniel Friesen - * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later - * @link http://www.mediawiki.org/wiki/Extension:Special404 Documentation + * @license https://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later + * @link https://www.mediawiki.org/wiki/Extension:Special404 Documentation */ -# Not a valid entry point, skip unless MEDIAWIKI is defined +// Ensure that the script cannot be executed outside of MediaWiki. if ( !defined( 'MEDIAWIKI' ) ) { - echo "Special404 extension"; - exit( 1 ); + die( 'This is an extension to MediaWiki and cannot be run standalone.' ); } +// Display extension properties on MediaWiki. $wgExtensionCredits['specialpage'][] = array( 'path' => __FILE__, 'author' => 'Daniel Friesen', @@ -24,13 +24,15 @@ 'license-name' => 'GPL-2.0+', ); -$dir = dirname( __FILE__ ); +// Register extension messages and other localisation. $wgMessagesDirs['Special404'] = __DIR__ . '/i18n'; -$wgExtensionMessagesFiles['Special404'] = $dir . '/Special404.i18n.php'; -$wgExtensionMessagesFiles['Special404Alias'] = $dir . '/Special404.alias.php'; +$wgExtensionMessagesFiles['Special404Alias'] = __DIR__ . '/Special404.alias.php'; +// Register special page with MediaWiki. $wgSpecialPages['Error404'] = 'Special404'; -$wgAutoloadClasses['Special404'] = $dir . '/Special404_body.php'; + +// Load extension's classes. +$wgAutoloadClasses['Special404'] = __DIR__ . '/Special404_body.php'; // Enable this to force an automatic 301 Moved Permanently redirect if a matching title exists // This might be useful if you used to use root /Article urls and moved to something else -- To view, visit https://gerrit.wikimedia.org/r/367861 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I47531fb5390c1794cec236a24c74e56b22c9840d Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Special404 Gerrit-Branch: master Gerrit-Owner: Kghbln <[email protected]> Gerrit-Reviewer: Daniel Friesen <[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
