r93240 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93239‎ | r93240 | r93241 >
Date:20:12, 26 July 2011
Author:aaron
Status:ok
Tags:
Comment:
Made setSiteInfoForMaintenance() support arguments of the form "script.php dbname" (lots of stuff still using this format in bin/)
Modified paths:
  • /trunk/tools/mwmultiversion/multiversion/MWMultiVersion.php (modified) (history)

Diff [purge]

Index: trunk/tools/mwmultiversion/multiversion/MWMultiVersion.php
@@ -152,9 +152,11 @@
153153 # The --wiki param must the second argument to to avoid
154154 # any "options with args" ambiguity (see Maintenance.php).
155155 if ( isset( $argv[1] ) && $argv[1] === '--wiki' ) {
156 - $dbname = isset( $argv[2] ) ? $argv[2] : '';
 156+ $dbname = isset( $argv[2] ) ? $argv[2] : ''; // "script.php --wiki dbname"
157157 } elseif ( isset( $argv[1] ) && substr( $argv[1], 0, 7 ) === '--wiki=' ) {
158 - $dbname = substr( $argv[1], 7 );
 158+ $dbname = substr( $argv[1], 7 ); // "script.php --wiki=dbname"
 159+ } elseif ( isset( $argv[1] )&& substr( $argv[1], 0, 2 ) !== '--' ) {
 160+ $dbname = $argv[1]; // "script.php dbname"
159161 } elseif ( $argv[0] === 'addwiki.php' ) {
160162 # Most scripts assume that the wiki already exists. addwiki.php is
161163 # obviously an exception. Go ahead and assumme aawiki as normal.

Status & tagging log