From 16a624984f57129f54c50ea511fb4e3125435a08 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sat, 14 Aug 2004 06:10:56 +0000 Subject: [PATCH] DB name feature from REL1_3 --- maintenance/commandLine.inc | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/maintenance/commandLine.inc b/maintenance/commandLine.inc index 10cf5625d6..72f1f19eb6 100644 --- a/maintenance/commandLine.inc +++ b/maintenance/commandLine.inc @@ -65,15 +65,27 @@ $sep = strchr( $include_path = ini_get( "include_path" ), ";" ) ? ";" : ":"; if ( $sep == ":" && strpos( `hostname`, "wikimedia.org" ) !== false ) { $wgWikiFarm = true; - if ( isset( $args[0] ) ) { - $lang = array_shift( $args ); - } else { - $lang = "aa"; - } - if ( isset( $args[0] ) ) { - $site = array_shift( $args ); - } else { - $site = "wikipedia"; + require_once( "$IP/includes/SiteConfiguration.php" ); + + # Get $conf + require( "$IP/InitialiseSettings.php" ); + + # Check if we were passed a db name + $db = array_shift( $args ); + list( $site, $lang ) = $conf->siteFromDB( $db ); + + # If not, work out the language and site the old way + if ( is_null( $site ) || is_null( $lang ) ) { + if ( !$db ) { + $lang = "aa"; + } else { + $lang = $db; + } + if ( isset( $args[0] ) ) { + $site = array_shift( $args ); + } else { + $site = "wikipedia"; + } } # This is for the IRC scripts, which now run as the apache user -- 2.20.1