Index: branches/wmf/1.18wmf1/maintenance/rebuildInterwiki.php |
— | — | @@ -150,7 +150,7 @@ |
151 | 151 | $sql .= "\n--$host\n\n"; |
152 | 152 | $sql .= "USE $db;\n" . |
153 | 153 | "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"; |
155 | 155 | $first = true; |
156 | 156 | |
157 | 157 | # Intermap links |
— | — | @@ -192,7 +192,7 @@ |
193 | 193 | |
194 | 194 | $sql .= "USE $db;\n" . |
195 | 195 | "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"; |
197 | 197 | $first = true; |
198 | 198 | |
199 | 199 | # Intermap links |
Index: branches/wmf/1.18wmf1/maintenance/dumpInterwiki.php |
— | — | @@ -187,7 +187,7 @@ |
188 | 188 | $lang = $matches[1]; |
189 | 189 | } |
190 | 190 | |
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" ); |
192 | 192 | if ( !$site ) { |
193 | 193 | $this->error( "Invalid database $db\n" ); |
194 | 194 | continue; |
— | — | @@ -242,7 +242,12 @@ |
243 | 243 | array_key_exists( $entry['iw_prefix'], $this->prefixRewrites[$source] ) ) { |
244 | 244 | $entry['iw_prefix'] = $this->prefixRewrites[$source][$entry['iw_prefix']]; |
245 | 245 | } |
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 | + } |
247 | 252 | if ( $this->dbFile ) { |
248 | 253 | $this->dbFile->set( "{$source}:{$entry['iw_prefix']}", trim( "{$entry['iw_local']} {$entry['iw_url']}" ) ); |
249 | 254 | } else { |