From c9b73a38bcdff36a4f96436092b96b88110aa6e1 Mon Sep 17 00:00:00 2001 From: Kevin Israel Date: Thu, 30 Apr 2015 23:32:44 -0400 Subject: [PATCH] convertExtensionToRegistration.php: Ignore i18n shims Bug: T91350 Change-Id: I18b35db14a13f58909bce83fec11bf9e8f10672d --- .../convertExtensionToRegistration.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/maintenance/convertExtensionToRegistration.php b/maintenance/convertExtensionToRegistration.php index 2fb36976bb..78b4e8c128 100644 --- a/maintenance/convertExtensionToRegistration.php +++ b/maintenance/convertExtensionToRegistration.php @@ -6,7 +6,7 @@ class ConvertExtensionToRegistration extends Maintenance { protected $custom = array( 'MessagesDirs' => 'handleMessagesDirs', - 'ExtensionMessagesFiles' => 'removeAbsolutePath', + 'ExtensionMessagesFiles' => 'handleExtensionMessagesFiles', 'AutoloadClasses' => 'removeAbsolutePath', 'ExtensionCredits' => 'handleCredits', 'ResourceModules' => 'handleResourceModules', @@ -79,7 +79,7 @@ class ConvertExtensionToRegistration extends Maintenance { } $realName = substr( $name, 2 ); // Strip 'wg' if ( isset( $this->custom[$realName] ) ) { - call_user_func_array( array( $this, $this->custom[$realName] ), array( $realName, $value ) ); + call_user_func_array( array( $this, $this->custom[$realName] ), array( $realName, $value, $vars ) ); } elseif ( in_array( $realName, $globalSettings ) ) { $this->json[$realName] = $value; } elseif ( strpos( $name, 'wg' ) === 0 ) { @@ -123,6 +123,21 @@ class ConvertExtensionToRegistration extends Maintenance { } } + protected function handleExtensionMessagesFiles( $realName, $value, $vars ) { + foreach ( $value as $key => $file ) { + $strippedFile = $this->stripPath( $file, $this->dir ); + if ( isset( $vars['wgMessagesDirs'][$key] ) ) { + $this->output( + "Note: Ignoring PHP shim $strippedFile. " . + "If your extension no longer supports versions of MediaWiki " . + "older than 1.23.0, you can safely delete it.\n" + ); + } else { + $this->json[$realName][$key] = $strippedFile; + } + } + } + private function stripPath( $val, $dir ) { if ( $val === $dir ) { $val = ''; -- 2.20.1