r98258 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98257‎ | r98258 | r98259 >
Date:21:16, 27 September 2011
Author:aaron
Status:ok
Tags:
Comment:
Allow overriding the dbname for "wikiless" scripts. We may want a wiki of specific version, not just what aawiki is running.
Modified paths:
  • /trunk/tools/mwmultiversion/multiversion/MWScript.php (modified) (history)

Diff [purge]

Index: trunk/tools/mwmultiversion/multiversion/MWScript.php
@@ -48,11 +48,16 @@
4949 'extensions/WikimediaMaintenance/dumpInterwiki.php', // 1.19
5050 'extensions/WikimediaMaintenance/rebuildInterwiki.php' // 1.19
5151 );
52 - if ( in_array( $relFile, $wikiless ) ) {
53 - # Assumme aawiki as Maintenance.php does.
54 - $argv = array_merge( array( $argv[0], "--wiki=aawiki" ), array_slice( $argv, 1 ) );
55 - };
5652
 53+ # Check if a --wiki param was given...
 54+ # Maintenance.php will treat $argv[1] as the wiki if it doesn't start '-'
 55+ if ( !isset( $argv[1] ) || !preg_match( '/^([^-]|--wiki(=|$))/', $argv[1] ) ) {
 56+ if ( in_array( $relFile, $wikiless ) ) {
 57+ # Assumme aawiki as Maintenance.php does.
 58+ $argv = array_merge( array( $argv[0], "--wiki=aawiki" ), array_slice( $argv, 1 ) );
 59+ }
 60+ }
 61+
5762 # MWScript.php should be in common/
5863 require_once( dirname( __FILE__ ) . '/MWVersion.php' );
5964 $file = getMediaWikiCli( $relFile );

Status & tagging log