r109618 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109617‎ | r109618 | r109619 >
Date:14:39, 20 January 2012
Author:reedy
Status:ok
Tags:
Comment:
Some fixes from r109617 brought in
Modified paths:
  • /branches/wmf/1.18wmf1/maintenance/dumpInterwiki.php (modified) (history)
  • /branches/wmf/1.18wmf1/maintenance/rebuildInterwiki.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/maintenance/rebuildInterwiki.php
@@ -150,7 +150,7 @@
151151 $sql .= "\n--$host\n\n";
152152 $sql .= "USE $db;\n" .
153153 "TRUNCATE TABLE interwiki;\n" .
154 - "INSERT INTO interwiki (iw_prefix, iw_url, iw_local) VALUES \n";
 154+ "INSERT IGNORE INTO interwiki (iw_prefix, iw_url, iw_local) VALUES \n";
155155 $first = true;
156156
157157 # Intermap links
@@ -192,7 +192,7 @@
193193
194194 $sql .= "USE $db;\n" .
195195 "TRUNCATE TABLE interwiki;\n" .
196 - "INSERT INTO interwiki (iw_prefix,iw_url,iw_local) VALUES\n";
 196+ "INSERT IGNORE INTO interwiki (iw_prefix,iw_url,iw_local) VALUES\n";
197197 $first = true;
198198
199199 # Intermap links
Index: branches/wmf/1.18wmf1/maintenance/dumpInterwiki.php
@@ -187,7 +187,7 @@
188188 $lang = $matches[1];
189189 }
190190
191 - $this->makeLink( array( 'iw_prefix' => $db, 'iw_url' => $site->suffix ), "__sites" );
 191+ $this->makeLink( array( 'iw_prefix' => $db, 'iw_url' => $site->suffix, 'iw_local' => 1 ), "__sites" );
192192 if ( !$site ) {
193193 $this->error( "Invalid database $db\n" );
194194 continue;
@@ -242,7 +242,12 @@
243243 array_key_exists( $entry['iw_prefix'], $this->prefixRewrites[$source] ) ) {
244244 $entry['iw_prefix'] = $this->prefixRewrites[$source][$entry['iw_prefix']];
245245 }
246 -
 246+ if ( !array_key_exists( "iw_local", $entry ) ) {
 247+ $entry["iw_local"] = 0;
 248+ }
 249+ if ( !array_key_exists( "iw_url", $entry ) ) {
 250+ return;
 251+ }
247252 if ( $this->dbFile ) {
248253 $this->dbFile->set( "{$source}:{$entry['iw_prefix']}", trim( "{$entry['iw_local']} {$entry['iw_url']}" ) );
249254 } else {

Follow-up revisions

RevisionCommit summaryAuthorDate
r110455Revert out part of r109618, after r110454reedy01:11, 1 February 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r109617Cleanup WikimediaMaintenance scripts slightly...reedy14:36, 20 January 2012

Status & tagging log