r9620 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r9619‎ | r9620 | r9621 >
Date:21:42, 24 June 2005
Author:timstarling
Status:old
Tags:
Comment:
added $wgNoDBParam option
Modified paths:
  • /trunk/phase3/maintenance/commandLine.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/commandLine.inc
@@ -84,22 +84,27 @@
8585 # Get $conf
8686 require( "$IP/InitialiseSettings.php" );
8787
88 - # Check if we were passed a db name
89 - $db = array_shift( $args );
90 - list( $site, $lang ) = $conf->siteFromDB( $db );
 88+ if ( empty( $wgNoDBParam ) ) {
 89+ # Check if we were passed a db name
 90+ $db = array_shift( $args );
 91+ list( $site, $lang ) = $conf->siteFromDB( $db );
9192
92 - # If not, work out the language and site the old way
93 - if ( is_null( $site ) || is_null( $lang ) ) {
94 - if ( !$db ) {
95 - $lang = "aa";
96 - } else {
97 - $lang = $db;
 93+ # If not, work out the language and site the old way
 94+ if ( is_null( $site ) || is_null( $lang ) ) {
 95+ if ( !$db ) {
 96+ $lang = "aa";
 97+ } else {
 98+ $lang = $db;
 99+ }
 100+ if ( isset( $args[0] ) ) {
 101+ $site = array_shift( $args );
 102+ } else {
 103+ $site = "wikipedia";
 104+ }
98105 }
99 - if ( isset( $args[0] ) ) {
100 - $site = array_shift( $args );
101 - } else {
102 - $site = "wikipedia";
103 - }
 106+ } else {
 107+ $lang = "aa";
 108+ $site = "wikipedia";
104109 }
105110
106111 # This is for the IRC scripts, which now run as the apache user

Status & tagging log