r4740 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r4739‎ | r4740 | r4741 >
Date:06:10, 14 August 2004
Author:timstarling
Status:old
Tags:
Comment:
DB name feature from REL1_3
Modified paths:
  • /trunk/phase3/maintenance/commandLine.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/commandLine.inc
@@ -65,16 +65,28 @@
6666
6767 if ( $sep == ":" && strpos( `hostname`, "wikimedia.org" ) !== false ) {
6868 $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+ }
7390 }
74 - if ( isset( $args[0] ) ) {
75 - $site = array_shift( $args );
76 - } else {
77 - $site = "wikipedia";
78 - }
7991
8092 # This is for the IRC scripts, which now run as the apache user
8193 # The apache user doesn't have access to the wikiadmin_pass command

Status & tagging log