r102389 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102388‎ | r102389 | r102390 >
Date:11:07, 8 November 2011
Author:catrope
Status:ok
Tags:
Comment:
1.18wmf1: MFT r102388
Modified paths:
  • /branches/wmf/1.18wmf1/maintenance/dumpInterwiki.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/maintenance/dumpInterwiki.php
@@ -81,6 +81,11 @@
8282 'wikiversity' => new Site( 'wikiversity', 'v', 'wikiversity.org' ),
8383 );
8484
 85+ # Site overrides for wikis whose DB names end in 'wiki' but that really belong to another site
 86+ $siteOverrides = array(
 87+ 'sourceswiki' => 'wikisource',
 88+ );
 89+
8590 # Extra interwiki links that can't be in the intermap for some reason
8691 $extraLinks = array(
8792 array( 'm', $this->urlprotocol . '//meta.wikimedia.org/wiki/$1', 1 ),
@@ -168,13 +173,18 @@
169174 } else {
170175 # Find out which site this DB belongs to
171176 $site = false;
172 - foreach ( $sites as $candidateSite ) {
173 - $suffix = $candidateSite->suffix;
174 - if ( preg_match( "/(.*)$suffix$/", $db, $matches ) ) {
175 - $site = $candidateSite;
176 - break;
 177+ if ( isset( $siteOverrides[$db] ) ) {
 178+ $site = $sites[$siteOverrides[$db]];
 179+ } else {
 180+ foreach ( $sites as $candidateSite ) {
 181+ $suffix = $candidateSite->suffix;
 182+ if ( preg_match( "/(.*)$suffix$/", $db, $matches ) ) {
 183+ $site = $candidateSite;
 184+ break;
 185+ }
177186 }
178187 }
 188+
179189 $this->makeLink( array( 'iw_prefix' => $db, 'iw_url' => $site->suffix ), "__sites" );
180190 if ( !$site ) {
181191 $this->error( "Invalid database $db\n" );
Property changes on: branches/wmf/1.18wmf1/maintenance/dumpInterwiki.php
___________________________________________________________________
Modified: svn:mergeinfo
182192 Merged /trunk/extensions/WikimediaMaintenance/dumpInterwiki.php:r102388

Follow-up revisions

RevisionCommit summaryAuthorDate
r1025581.18wmf1: MFT r102545catrope18:56, 9 November 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r102388(bug 29591) Special-case sourceswiki in the interwiki mapcatrope11:05, 8 November 2011

Status & tagging log