Index: branches/REL1_4/phase3/maintenance/rebuildInterwiki.inc |
— | — | @@ -9,11 +9,7 @@ |
10 | 10 | */ |
11 | 11 | |
12 | 12 | /** */ |
13 | | -$oldCwd = getcwd(); |
14 | 13 | |
15 | | -$optionsWithArgs = array( "o" ); |
16 | | -include_once( "commandLine.inc" ); |
17 | | - |
18 | 14 | /** |
19 | 15 | * @todo document |
20 | 16 | * @package MediaWiki |
— | — | @@ -41,7 +37,8 @@ |
42 | 38 | 'wiki' => new Site( 'wiki', 'w', 'wikipedia.org' ), |
43 | 39 | 'wiktionary' => new Site( 'wiktionary', 'wikt', 'wiktionary.org' ), |
44 | 40 | 'wikiquote' => new Site( 'wikiquote', 'q', 'wikiquote.org' ), |
45 | | - 'wikibooks' => new Site( 'wikibooks', 'b', 'wikibooks.org' ) |
| 41 | + 'wikibooks' => new Site( 'wikibooks', 'b', 'wikibooks.org' ), |
| 42 | + 'wikinews' => new Site( 'wikinews', 'n', 'wikinews.org' ), |
46 | 43 | ); |
47 | 44 | $langlist = array_map( "trim", file( "/home/wikipedia/common/langlist" ) ); |
48 | 45 | $dblist = array_map( "trim", file( "/home/wikipedia/common/all.dblist" ) ); |
— | — | @@ -64,6 +61,7 @@ |
65 | 62 | 'zh-cn' => 'zh', |
66 | 63 | 'zh-tw' => 'zh', |
67 | 64 | 'dk' => 'da', |
| 65 | + 'nb' => 'no', |
68 | 66 | ); |
69 | 67 | |
70 | 68 | # Construct a list of reserved prefixes |
— | — | @@ -79,8 +77,8 @@ |
80 | 78 | } |
81 | 79 | |
82 | 80 | # Extract the intermap from meta |
83 | | - $dbr =& wfGetDB( DB_WRITE ); |
84 | | - $row = $dbr->selectRow( "metawiki.cur", array( "cur_text" ), |
| 81 | + $dbr =& wfGetDB( DB_SLAVE ); |
| 82 | + $row = $dbr->selectRow( "`metawiki`.cur", array( "cur_text" ), |
85 | 83 | array( "cur_namespace" => 0, "cur_title" => "Interwiki_map" ) ); |
86 | 84 | |
87 | 85 | if ( !$row ) { |
— | — | @@ -101,7 +99,7 @@ |
102 | 100 | } |
103 | 101 | |
104 | 102 | if ( empty( $reserved[$prefix] ) ) { |
105 | | - $iwArray[] = array( "iw_prefix" => $prefix, "iw_url" => $url, "iw_local" => $local ); |
| 103 | + $iwArray[$prefix] = array( "iw_prefix" => $prefix, "iw_url" => $url, "iw_local" => $local ); |
106 | 104 | } |
107 | 105 | } |
108 | 106 | } |
— | — | @@ -229,7 +227,8 @@ |
230 | 228 | } else { |
231 | 229 | $sql .= ",\n"; |
232 | 230 | } |
233 | | - $sql .= "(" . Database::makeList( $entry ) . ")"; |
| 231 | + $dbr =& wfGetDB( DB_SLAVE ); |
| 232 | + $sql .= "(" . $dbr->makeList( $entry ) . ")"; |
234 | 233 | return $sql; |
235 | 234 | } |
236 | 235 | |
Index: branches/REL1_4/phase3/maintenance/commandLine.inc |
— | — | @@ -88,22 +88,27 @@ |
89 | 89 | # Get $conf |
90 | 90 | require( "$IP/InitialiseSettings.php" ); |
91 | 91 | |
92 | | - # Check if we were passed a db name |
93 | | - $db = array_shift( $args ); |
94 | | - list( $site, $lang ) = $conf->siteFromDB( $db ); |
| 92 | + if ( empty( $wgNoDBParam ) ) { |
| 93 | + # Check if we were passed a db name |
| 94 | + $db = array_shift( $args ); |
| 95 | + list( $site, $lang ) = $conf->siteFromDB( $db ); |
95 | 96 | |
96 | | - # If not, work out the language and site the old way |
97 | | - if ( is_null( $site ) || is_null( $lang ) ) { |
98 | | - if ( !$db ) { |
99 | | - $lang = "aa"; |
100 | | - } else { |
101 | | - $lang = $db; |
| 97 | + # If not, work out the language and site the old way |
| 98 | + if ( is_null( $site ) || is_null( $lang ) ) { |
| 99 | + if ( !$db ) { |
| 100 | + $lang = "aa"; |
| 101 | + } else { |
| 102 | + $lang = $db; |
| 103 | + } |
| 104 | + if ( isset( $args[0] ) ) { |
| 105 | + $site = array_shift( $args ); |
| 106 | + } else { |
| 107 | + $site = "wikipedia"; |
| 108 | + } |
102 | 109 | } |
103 | | - if ( isset( $args[0] ) ) { |
104 | | - $site = array_shift( $args ); |
105 | | - } else { |
106 | | - $site = "wikipedia"; |
107 | | - } |
| 110 | + } else { |
| 111 | + $lang = "aa"; |
| 112 | + $site = "wikipedia"; |
108 | 113 | } |
109 | 114 | |
110 | 115 | # This is for the IRC scripts, which now run as the apache user |