r47704 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47703‎ | r47704 | r47705 >
Date:12:37, 23 February 2009
Author:tstarling
Status:ok
Tags:
Comment:
* Remove /home references in wikimedia mode
* Allow MW_INSTALL_PATH='' as a shortcut for deletion of the environment variable
Modified paths:
  • /trunk/phase3/maintenance/commandLine.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/commandLine.inc
@@ -40,9 +40,9 @@
4141 $optionsWithArgs[] = 'wiki'; # For specifying the wiki ID
4242
4343 $self = array_shift( $argv );
44 -$IP = ( getenv('MW_INSTALL_PATH') !== false
 44+$IP = strval( getenv('MW_INSTALL_PATH') ) !== ''
4545 ? getenv('MW_INSTALL_PATH')
46 - : realpath( dirname( __FILE__ ) . '/..' ) );
 46+ : realpath( dirname( __FILE__ ) . '/..' );
4747 #chdir( $IP );
4848 require_once( "$IP/StartProfiler.php" );
4949
@@ -112,9 +112,8 @@
113113 $wgUseNormalUser = false;
114114 }
115115
116 -if ( file_exists( '/home/wikipedia/common/langlist' ) ) {
 116+if ( file_exists( dirname(__FILE__).'/wikimedia-mode' ) ) {
117117 $wgWikiFarm = true;
118 - #$cluster = trim( file_get_contents( '/etc/cluster' ) );
119118 $cluster = 'pmtpa';
120119 require_once( "$IP/includes/AutoLoader.php" );
121120 require_once( "$IP/includes/SiteConfiguration.php" );
@@ -166,16 +165,10 @@
167166 }
168167
169168 #require_once( $IP.'/includes/ProfilerStub.php' );
170 - require_once( $IP.'/includes/Defines.php' );
171 - require_once( $IP.'/CommonSettings.php' );
172 -
173 - $bin = '/home/wikipedia/bin';
174 - if ( $wgUseRootUser ) {
175 - $wgDBuser = $wgDBadminuser = 'root';
176 - $wgDBpassword = $wgDBadminpassword = trim(`$bin/mysql_root_pass`);
177 - } elseif ( !$wgUseNormalUser ) {
178 - $wgDBuser = $wgDBadminuser = 'wikiadmin';
179 - $wgDBpassword = $wgDBadminpassword = trim(`$bin/wikiadmin_pass`);
 169+ require( $IP.'/includes/Defines.php' );
 170+ require( $IP.'/CommonSettings.php' );
 171+ if ( !$wgUseNormalUser ) {
 172+ require( $IP.'/AdminSettings.php' );
180173 }
181174 } else {
182175 $wgWikiFarm = false;

Status & tagging log