jenkins-bot has submitted this change and it was merged.

Change subject: Don't apply language aliases outside of production
......................................................................


Don't apply language aliases outside of production

E.g. labs doesn't use these

Bug: T112006
Change-Id: I55868d994086a5e2555a37c5d8148ee3c37b3b41
---
M dumpInterwiki.php
1 file changed, 11 insertions(+), 5 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/dumpInterwiki.php b/dumpInterwiki.php
index 3724c0c..078b0ac 100644
--- a/dumpInterwiki.php
+++ b/dumpInterwiki.php
@@ -255,7 +255,7 @@
        }
 
        function getRebuildInterwikiDump() {
-               global $wgContLang;
+               global $wgContLang, $wmfRealm;
 
                $sites = $this->getSites();
                $extraLinks = $this->getExtraLinks();
@@ -265,8 +265,10 @@
                foreach ( $this->langlist as $lang ) {
                        $reserved[$lang] = 1;
                }
-               foreach ( self::$languageAliases as $alias => $lang ) {
-                       $reserved[$alias] = 1;
+               if ( $wmfRealm === 'production' ) {
+                       foreach ( self::$languageAliases as $alias => $lang ) {
+                               $reserved[$alias] = 1;
+                       }
                }
 
                /**
@@ -403,14 +405,18 @@
         * @param $source
         */
        function makeLanguageLinks( &$site, $source ) {
+               global $wmfRealm;
+
                // Actual languages with their own databases
                foreach ( $this->langlist as $targetLang ) {
                        $this->makeLink( array( $targetLang, $site->getURL( 
$targetLang, $this->urlprotocol ), 1 ), $source );
                }
 
                // Language aliases
-               foreach ( self::$languageAliases as $alias => $lang ) {
-                       $this->makeLink( array( $alias, $site->getURL( $lang, 
$this->urlprotocol ), 1 ), $source );
+               if ( $wmfRealm === 'production' ) {
+                       foreach ( self::$languageAliases as $alias => $lang ) {
+                               $this->makeLink( array( $alias, $site->getURL( 
$lang, $this->urlprotocol ), 1 ), $source );
+                       }
                }
 
                // Additional links

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I55868d994086a5e2555a37c5d8148ee3c37b3b41
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaMaintenance
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <[email protected]>
Gerrit-Reviewer: BryanDavis <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to