Index: trunk/phase3/maintenance/commandLine.inc |
— | — | @@ -65,16 +65,28 @@ |
66 | 66 | |
67 | 67 | if ( $sep == ":" && strpos( `hostname`, "wikimedia.org" ) !== false ) { |
68 | 68 | $wgWikiFarm = true; |
69 | | - if ( isset( $args[0] ) ) { |
70 | | - $lang = array_shift( $args ); |
71 | | - } else { |
72 | | - $lang = "aa"; |
| 69 | + require_once( "$IP/includes/SiteConfiguration.php" ); |
| 70 | + |
| 71 | + # Get $conf |
| 72 | + require( "$IP/InitialiseSettings.php" ); |
| 73 | + |
| 74 | + # Check if we were passed a db name |
| 75 | + $db = array_shift( $args ); |
| 76 | + list( $site, $lang ) = $conf->siteFromDB( $db ); |
| 77 | + |
| 78 | + # If not, work out the language and site the old way |
| 79 | + if ( is_null( $site ) || is_null( $lang ) ) { |
| 80 | + if ( !$db ) { |
| 81 | + $lang = "aa"; |
| 82 | + } else { |
| 83 | + $lang = $db; |
| 84 | + } |
| 85 | + if ( isset( $args[0] ) ) { |
| 86 | + $site = array_shift( $args ); |
| 87 | + } else { |
| 88 | + $site = "wikipedia"; |
| 89 | + } |
73 | 90 | } |
74 | | - if ( isset( $args[0] ) ) { |
75 | | - $site = array_shift( $args ); |
76 | | - } else { |
77 | | - $site = "wikipedia"; |
78 | | - } |
79 | 91 | |
80 | 92 | # This is for the IRC scripts, which now run as the apache user |
81 | 93 | # The apache user doesn't have access to the wikiadmin_pass command |