apply live hacks from wikimedia site:
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 12 May 2008 22:01:44 +0000 (22:01 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 12 May 2008 22:01:44 +0000 (22:01 +0000)
* fix $wgDBadminuser/pass usage with new load balancer
* some test.wikipedia check... yay hardcoded crap :D
* hardcoded wikimedia PMTPA check, yay

maintenance/commandLine.inc

index 29bb84a..6b86384 100644 (file)
@@ -111,7 +111,8 @@ if (!isset( $wgUseNormalUser ) ) {
 
 if ( file_exists( '/home/wikipedia/common/langlist' ) ) {
        $wgWikiFarm = true;
-       $cluster = trim( file_get_contents( '/etc/cluster' ) );
+       #$cluster = trim( file_get_contents( '/etc/cluster' ) );
+       $cluster = 'pmtpa';
        require_once( "$IP/includes/SiteConfiguration.php" );
 
        # Get $wgConf
@@ -152,6 +153,10 @@ if ( file_exists( '/home/wikipedia/common/langlist' ) ) {
        $DP = $IP;
        ini_set( 'include_path', ".:$IP:$IP/includes:$IP/languages:$IP/maintenance" );
 
+       if ( $lang == 'test' && $site == 'wikipedia' ) {
+               define( 'TESTWIKI', 1 );
+       }
+       
        #require_once( $IP.'/includes/ProfilerStub.php' );
        require_once( $IP.'/includes/Defines.php' );
        require_once( $IP.'/CommonSettings.php' );
@@ -209,6 +214,10 @@ if ( empty( $wgUseNormalUser ) && isset( $wgDBadminuser ) ) {
                        $wgDBservers[$i]['password'] = $wgDBpassword;
                }
        }
+       if( isset( $wgLBFactoryConf['serverTemplate'] ) ) {
+               $wgLBFactoryConf['serverTemplate']['user'] = $wgDBuser;
+               $wgLBFactoryConf['serverTemplate']['password'] = $wgDBpassword;
+       }
 }
 
 if ( defined( 'MW_CMDLINE_CALLBACK' ) ) {