PleaseStand has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/125925

Change subject: Skip loading PHP shims for JSON i18n files
......................................................................

Skip loading PHP shims for JSON i18n files

For now, non-message data (e.g. special page aliases, magic words) belong
in separate files having their own keys in $wgExtensionMessagesFiles. It
is unnecessary to read any PHP files listed under keys that exist in
$wgMessagesDirs; they are merely compatibility shims.

Bug: 63926
Change-Id: I92013d0a45e83ad0f5ac483a3db867806eb71f8a
---
M includes/cache/LocalisationCache.php
1 file changed, 5 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/25/125925/1

diff --git a/includes/cache/LocalisationCache.php 
b/includes/cache/LocalisationCache.php
index b89316b..ac45330 100644
--- a/includes/cache/LocalisationCache.php
+++ b/includes/cache/LocalisationCache.php
@@ -875,17 +875,15 @@
                }
 
                foreach ( $wgExtensionMessagesFiles as $extension => $fileName 
) {
+                       if ( isset( $wgMessagesDirs[$extension] ) ) {
+                               # Already loaded the JSON file for this 
extension; skip the PHP shim
+                               continue;
+                       }
+
                        $data = $this->readPHPFile( $fileName, 'extension' );
                        $used = false;
 
                        foreach ( $data as $key => $item ) {
-                               if ( $key === 'messages' && isset( 
$wgMessagesDirs[$extension] ) ) {
-                                       # For backwards compatibility, ignore 
messages from extensions in
-                                       # $wgExtensionMessagesFiles that are 
also present in $wgMessagesDirs.
-                                       # This allows extensions to use both 
and be backwards compatible.
-                                       # Variables other than $messages still 
need to be supported though.
-                                       continue;
-                               }
                                if ( $this->mergeExtensionItem( $codeSequence, 
$key, $allData[$key], $item ) ) {
                                        $used = true;
                                }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I92013d0a45e83ad0f5ac483a3db867806eb71f8a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: PleaseStand <[email protected]>

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

Reply via email to