From: Kevin Israel Date: Fri, 1 May 2015 03:32:44 +0000 (-0400) Subject: convertExtensionToRegistration.php: Ignore i18n shims X-Git-Tag: 1.31.0-rc.0~11524^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=c9b73a38bcdff36a4f96436092b96b88110aa6e1;p=lhc%2Fweb%2Fwiklou.git convertExtensionToRegistration.php: Ignore i18n shims Bug: T91350 Change-Id: I18b35db14a13f58909bce83fec11bf9e8f10672d --- 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 = '';