Index: trunk/phase3/maintenance/commandLine.inc |
— | — | @@ -37,6 +37,7 @@ |
38 | 38 | } |
39 | 39 | $optionsWithArgs[] = 'conf'; # For specifying the location of LocalSettings.php |
40 | 40 | $optionsWithArgs[] = 'aconf'; # As above for AdminSettings.php |
| 41 | +$optionsWithArgs[] = 'wiki'; # For specifying the wiki ID |
41 | 42 | |
42 | 43 | $self = array_shift( $argv ); |
43 | 44 | $IP = ( getenv('MW_INSTALL_PATH') !== false |
— | — | @@ -122,7 +123,11 @@ |
123 | 124 | |
124 | 125 | if ( empty( $wgNoDBParam ) ) { |
125 | 126 | # Check if we were passed a db name |
126 | | - $db = array_shift( $args ); |
| 127 | + if ( isset( $options['wiki'] ) ) { |
| 128 | + $db = $options['wiki']; |
| 129 | + } else { |
| 130 | + $db = array_shift( $args ); |
| 131 | + } |
127 | 132 | list( $site, $lang ) = $wgConf->siteFromDB( $db ); |
128 | 133 | |
129 | 134 | # If not, work out the language and site the old way |
— | — | @@ -178,6 +183,14 @@ |
179 | 184 | } else { |
180 | 185 | $settingsFile = "$IP/LocalSettings.php"; |
181 | 186 | } |
| 187 | + if ( isset( $options['wiki'] ) ) { |
| 188 | + $bits = explode( '-', $options['wiki'] ); |
| 189 | + if ( count( $bits ) == 1 ) { |
| 190 | + $bits[] = ''; |
| 191 | + } |
| 192 | + define( 'MW_DB', $bits[0] ); |
| 193 | + define( 'MW_PREFIX', $bits[1] ); |
| 194 | + } |
182 | 195 | |
183 | 196 | if ( ! is_readable( $settingsFile ) ) { |
184 | 197 | print "A copy of your installation's LocalSettings.php\n" . |