Index: trunk/tools/mwmultiversion/wmf-config/CommonSettings.php |
— | — | @@ -42,20 +42,21 @@ |
43 | 43 | #---------------------------------------------------------------------- |
44 | 44 | # Initialisation |
45 | 45 | |
46 | | -# Get the version object for this Wiki (must be set by now, along with $IP) |
47 | | -require_once( dirname( __FILE__ ) . "/../multiversion/MWMultiVersion.php" ); |
48 | | -$multiVersion = MWMultiVersion::getInstance(); |
49 | 46 | /* |
50 | 47 | if ( !$multiVersion ) { |
51 | 48 | die( "No MWMultiVersion instance initialized! Wrapper not used?" ); |
52 | 49 | } |
53 | 50 | */ |
54 | | -if ( !$multiVersion && php_sapi_name() == 'cli' ) { |
| 51 | +if ( !isset( $IP ) && php_sapi_name() == 'cli' ) { |
55 | 52 | # Allow for now since everything is 1.17 and we don't want scripts to break |
| 53 | + require_once( dirname( __FILE__ ) . "/../multiversion/MWMultiVersion.php" ); |
56 | 54 | $multiVersion = MWMultiVersion::initializeForMaintenance(); |
| 55 | + echo "MWVersion wrapper not used!\n"; |
57 | 56 | } |
58 | | -$wgDBname = $multiVersion->getDatabase(); |
59 | 57 | |
| 58 | +# Get the version object for this Wiki (must be set by now, along with $IP) |
| 59 | +$multiVersion = MWMultiVersion::getInstance(); |
| 60 | + |
60 | 61 | set_include_path( "$IP:$IP/lib:/usr/local/lib/php:/usr/share/php" ); |
61 | 62 | |
62 | 63 | if( getenv( 'WIKIBACKUP' ) ) { |
— | — | @@ -82,6 +83,9 @@ |
83 | 84 | |
84 | 85 | $DP = $IP; |
85 | 86 | |
| 87 | +# This must be set *after* the DefaultSettings.php inclusion |
| 88 | +$wgDBname = $multiVersion->getDatabase(); |
| 89 | + |
86 | 90 | wfProfileOut( "$fname-init" ); |
87 | 91 | wfProfileIn( "$fname-host" ); |
88 | 92 | |