Index: trunk/tools/mwmultiversion/wmf-config/CommonSettings.php |
— | — | @@ -47,11 +47,13 @@ |
48 | 48 | die( "No MWMultiVersion instance initialized! Wrapper not used?" ); |
49 | 49 | } |
50 | 50 | */ |
51 | | -if ( !isset( $IP ) && php_sapi_name() == 'cli' ) { |
| 51 | +if ( !class_exists( 'MWMultiVersion' ) && php_sapi_name() == 'cli' ) { |
| 52 | + global $argv; |
52 | 53 | # Allow for now since everything is 1.17 and we don't want scripts to break |
53 | 54 | require_once( dirname( __FILE__ ) . "/../multiversion/MWMultiVersion.php" ); |
54 | | - $multiVersion = MWMultiVersion::initializeForMaintenance(); |
55 | | - echo "MWVersion wrapper not used!\n"; |
| 55 | + array_unshift( $argv, 'rein' ); // HACK for maintenance.php stripping argv[0] |
| 56 | + MWMultiVersion::initializeForMaintenance(); |
| 57 | + array_shift( $argv ); // HACK for maintenance.php stripping argv[0] |
56 | 58 | } |
57 | 59 | |
58 | 60 | # Get the version object for this Wiki (must be set by now, along with $IP) |