r93230 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93229‎ | r93230 | r93231 >
Date:18:50, 26 July 2011
Author:aaron
Status:ok
Tags:
Comment:
Updates from live version:
* $wgDBname was moved down to be set where it always used to be. It can't be above the DefaultSettings.php line.
* Tweaked cli b/c fallback when no wrapper is used. The require_once() failed to avoid re-declaration errors for some reason.
Modified paths:
  • /trunk/tools/mwmultiversion/wmf-config/CommonSettings.php (modified) (history)

Diff [purge]

Index: trunk/tools/mwmultiversion/wmf-config/CommonSettings.php
@@ -42,20 +42,21 @@
4343 #----------------------------------------------------------------------
4444 # Initialisation
4545
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();
4946 /*
5047 if ( !$multiVersion ) {
5148 die( "No MWMultiVersion instance initialized! Wrapper not used?" );
5249 }
5350 */
54 -if ( !$multiVersion && php_sapi_name() == 'cli' ) {
 51+if ( !isset( $IP ) && php_sapi_name() == 'cli' ) {
5552 # Allow for now since everything is 1.17 and we don't want scripts to break
 53+ require_once( dirname( __FILE__ ) . "/../multiversion/MWMultiVersion.php" );
5654 $multiVersion = MWMultiVersion::initializeForMaintenance();
 55+ echo "MWVersion wrapper not used!\n";
5756 }
58 -$wgDBname = $multiVersion->getDatabase();
5957
 58+# Get the version object for this Wiki (must be set by now, along with $IP)
 59+$multiVersion = MWMultiVersion::getInstance();
 60+
6061 set_include_path( "$IP:$IP/lib:/usr/local/lib/php:/usr/share/php" );
6162
6263 if( getenv( 'WIKIBACKUP' ) ) {
@@ -82,6 +83,9 @@
8384
8485 $DP = $IP;
8586
 87+# This must be set *after* the DefaultSettings.php inclusion
 88+$wgDBname = $multiVersion->getDatabase();
 89+
8690 wfProfileOut( "$fname-init" );
8791 wfProfileIn( "$fname-host" );
8892

Status & tagging log