Kghbln has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/367864 )

Change subject: Remove I18n php shim and bump version
......................................................................

Remove I18n php shim and bump version

Note: This is breaking for MW 1.22.x and earlier.

Bug:T168353
Change-Id: I882ef17d375355aec2729e9ffe4f9026fb3e852e
---
D Sudo.i18n.php
M Sudo.php
2 files changed, 8 insertions(+), 42 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Sudo 
refs/changes/64/367864/1

diff --git a/Sudo.i18n.php b/Sudo.i18n.php
deleted file mode 100644
index 34c79a3..0000000
--- a/Sudo.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( 'wfJsonI18nShim490afb0e136088e5' ) ) {
-       function wfJsonI18nShim490afb0e136088e5( $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'][] = 
'wfJsonI18nShim490afb0e136088e5';
-}
diff --git a/Sudo.php b/Sudo.php
index 52aa26d..97f30aa 100644
--- a/Sudo.php
+++ b/Sudo.php
@@ -9,17 +9,18 @@
  * @link https://www.mediawiki.org/wiki/Extension:Sudo Documentation
  */
 
+// Ensure that the script cannot be executed outside of MediaWiki.
 if( !defined( 'MEDIAWIKI' ) ) {
        die( 'This is an extension to the MediaWiki package and cannot be run 
standalone.' );
 }
 
-// Extension credits that will show up on Special:Version
+// Display extension properties on MediaWiki.
 $wgExtensionCredits['other'][] = array(
        'path' => __FILE__,
        'name' => 'Sudo',
-       'version' => '0.4.0',
+       'version' => '0.5.0',
        'author' => array(
-               '[http://danf.ca/mw/ Daniel Friesen]',
+               '[https://www.mediawiki.org/wiki/User:Dantman Daniel Friesen]',
                '...'
        ),
        'descriptionmsg' => 'sudo-desc',
@@ -27,12 +28,11 @@
        'license-name' => 'GPL-2.0+',
 );
 
-// Set up i18n
+// Register extension messages and other localisation.
 $wgMessagesDirs['Sudo'] = __DIR__ . '/i18n';
-$wgExtensionMessagesFiles['Sudo'] = __DIR__ . '/Sudo.i18n.php';
 $wgExtensionMessagesFiles['SudoAlias'] = __DIR__ . '/Sudo.alias.php';
 
-// New sepecial page
+// Provide new sepecial page
 $wgAutoloadClasses['SpecialSudo'] = __DIR__ . '/SpecialSudo.php';
 $wgSpecialPages['Sudo'] = 'SpecialSudo';
 
@@ -45,10 +45,11 @@
 $wgLogHeaders['sudo'] = 'sudo-logpagetext';
 $wgLogActions['sudo/sudo'] = 'sudo-logentry';
 
-// Hooked functions
+// Register extension hooks.
 $wgHooks['UserLogoutComplete'][] = 'wfSudoLogout';
 $wgHooks['PersonalUrls'][] = 'wfSudoPersonalUrls';
 
+// Do the extension's action.
 function wfSudoLogout( &$user, &$inject_html ) {
        // Unset wsSudoId when we logout.
        // We don't want to be in a sudo login while logged out.

-- 
To view, visit https://gerrit.wikimedia.org/r/367864
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I882ef17d375355aec2729e9ffe4f9026fb3e852e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Sudo
Gerrit-Branch: master
Gerrit-Owner: Kghbln <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to