r93845 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93844‎ | r93845 | r93846 >
Date:18:00, 3 August 2011
Author:aaron
Status:ok
Tags:
Comment:
* Pushed implicit --wiki=aawiki param code up to MWScript.php, which avoids problems with files with the same name. It will no longer be assumed without the wrapper, but the callers using the scripts in the list were updated to use --wiki anyway.
* Added mctest.php & removed mergeMessageFileList.php (we don't want to run this on any random version) to implicit aawiki script list.
Modified paths:
  • /trunk/tools/mwmultiversion/multiversion/MWMultiVersion.php (modified) (history)
  • /trunk/tools/mwmultiversion/multiversion/MWScript.php (modified) (history)

Diff [purge]

Index: trunk/tools/mwmultiversion/multiversion/MWMultiVersion.php
@@ -169,11 +169,6 @@
170170 $dbname = substr( $argv[1], 7 ); // "script.php --wiki=dbname"
171171 } elseif ( isset( $argv[1] ) && substr( $argv[1], 0, 2 ) !== '--' ) {
172172 $dbname = $argv[1]; // "script.php dbname"
173 - } elseif ( in_array( $argv[0], self::wikilessScripts() ) ) {
174 - # For addwiki.php, the DB doesn't yet exist, and for nextJobDB.php
175 - # we don't care what DB we use. Assumme aawiki as Maintenance.php does.
176 - $dbname = 'aawiki';
177 - $argv = array_merge( array( $argv[0], "--wiki=$dbname" ), array_slice( $argv, 1 ) );
178173 }
179174
180175 if ( $dbname === '' ) {
@@ -189,7 +184,7 @@
190185 * @return Array
191186 */
192187 private static function wikilessScripts() {
193 - return array( 'addwiki.php', 'nextJobDB.php', 'mergeMessageFileList.php' );
 188+ return array( 'addwiki.php', 'nextJobDB.php' );
194189 }
195190
196191 /**
Index: trunk/tools/mwmultiversion/multiversion/MWScript.php
@@ -36,6 +36,18 @@
3737 $argv[0] = $matches[1]; // make first arg the script file name
3838 }
3939
 40+ # For addwiki.php, the wiki DB doesn't yet exist, and for some
 41+ # other maintenance scripts we don't care what wiki DB is used...
 42+ $wikiless = array(
 43+ 'maintenance/mctest.php',
 44+ 'maintenance/addwiki.php',
 45+ 'maintenance/nextJobDB.php'
 46+ );
 47+ if ( in_array( $relFile, $wikiless ) ) {
 48+ # Assumme aawiki as Maintenance.php does.
 49+ $argv = array_merge( array( $argv[0], "--wiki=aawiki" ), array_slice( $argv, 1 ) );
 50+ };
 51+
4052 # MWScript.php should be in common/
4153 require_once( dirname( __FILE__ ) . '/MWVersion.php' );
4254 $file = getMediaWikiCli( $relFile );

Follow-up revisions

RevisionCommit summaryAuthorDate
r93846Follow-up r93845: removed unused functionaaron18:22, 3 August 2011

Status & tagging log