From: Tim Starling Date: Sat, 14 Aug 2004 06:10:56 +0000 (+0000) Subject: DB name feature from REL1_3 X-Git-Tag: 1.5.0alpha1~2375 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/ajouter.php?a=commitdiff_plain;h=16a624984f57129f54c50ea511fb4e3125435a08;p=lhc%2Fweb%2Fwiklou.git DB name feature from REL1_3 --- 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