r102388 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102387‎ | r102388 | r102389 >
Date:11:05, 8 November 2011
Author:catrope
Status:resolved (Comments)
Tags:
Comment:
(bug 29591) Special-case sourceswiki in the interwiki map
Modified paths:
  • /trunk/extensions/WikimediaMaintenance/dumpInterwiki.php (modified) (history)

Diff [purge]

Index: trunk/extensions/WikimediaMaintenance/dumpInterwiki.php
@@ -89,6 +89,11 @@
9090 'wikiversity' => new WMFSite( 'wikiversity', 'v', 'wikiversity.org' ),
9191 );
9292
 93+ # Site overrides for wikis whose DB names end in 'wiki' but that really belong to another site
 94+ $siteOverrides = array(
 95+ 'sourceswiki' => 'wikisource',
 96+ );
 97+
9398 # Extra interwiki links that can't be in the intermap for some reason
9499 $extraLinks = array(
95100 array( 'm', $this->urlprotocol . '//meta.wikimedia.org/wiki/$1', 1 ),
@@ -176,13 +181,18 @@
177182 } else {
178183 # Find out which site this DB belongs to
179184 $site = false;
180 - foreach ( $sites as $candidateSite ) {
181 - $suffix = $candidateSite->suffix;
182 - if ( preg_match( "/(.*)$suffix$/", $db, $matches ) ) {
183 - $site = $candidateSite;
184 - break;
 185+ if ( isset( $siteOverrides[$db] ) ) {
 186+ $site = $sites[$siteOverrides[$db]];
 187+ } else {
 188+ foreach ( $sites as $candidateSite ) {
 189+ $suffix = $candidateSite->suffix;
 190+ if ( preg_match( "/(.*)$suffix$/", $db, $matches ) ) {
 191+ $site = $candidateSite;
 192+ break;
 193+ }
185194 }
186195 }
 196+
187197 $this->makeLink( array( 'iw_prefix' => $db, 'iw_url' => $site->suffix ), "__sites" );
188198 if ( !$site ) {
189199 $this->error( "Invalid database $db\n" );

Follow-up revisions

RevisionCommit summaryAuthorDate
r1023891.18wmf1: MFT r102388catrope11:07, 8 November 2011
r102545Followup r102388: fix regression where on sourceswiki (and any other sites in...catrope17:38, 9 November 2011

Comments

#Comment by Nemo bis (talk | contribs)   08:39, 9 November 2011

I think a piece is still missing: https://wikisource.org/?diff=322190&oldid=322117 w: should point to en.wiki, although it's not so important. (Noted also on https://bugzilla.wikimedia.org/show_bug.cgi?id=29591#c10 .)

#Comment by Catrope (talk | contribs)   17:55, 9 November 2011

Fixed in followup r102545

Status & tagging log