From: Brion Vibber Date: Mon, 6 Dec 2004 01:14:53 +0000 (+0000) Subject: * Fix for load balancing mode, notify if using old settings format X-Git-Tag: 1.5.0alpha1~1143 X-Git-Url: https://git.cyclocoop.org/admin/?a=commitdiff_plain;h=b464cb7b97b5bb4eed62a67e0e0a401fd4175d44;p=lhc%2Fweb%2Fwiklou.git * Fix for load balancing mode, notify if using old settings format --- diff --git a/includes/LoadBalancer.php b/includes/LoadBalancer.php index 9813c2af42..7ea09fcab6 100644 --- a/includes/LoadBalancer.php +++ b/includes/LoadBalancer.php @@ -191,7 +191,7 @@ class LoadBalancer { } if ( !$retVal && $this->isOpen( $index ) ) { - $conn =& $this->mConnections( $index ); + $conn =& $this->mConnections[$index]; wfDebug( "Waiting for slave #$index to catch up...\n" ); $result = $conn->masterPosWait( $this->mWaitForFile, $this->mWaitForPos, MASTER_WAIT_TIMEOUT ); @@ -303,15 +303,19 @@ class LoadBalancer { * @private */ function reallyOpenConnection( &$server ) { - extract( $server ); - # Get class for this database type - $class = 'Database' . ucfirst( $type ); - if ( !class_exists( $class ) ) { - require_once( "$class.php" ); - } + if( !is_array( $server ) ) { + wfDebugDieBacktrace( 'You must update your load-balancing configuration. See DefaultSettings.php entry for $wgDBservers.' ); + } + + extract( $server ); + # Get class for this database type + $class = 'Database' . ucfirst( $type ); + if ( !class_exists( $class ) ) { + require_once( "$class.php" ); + } - # Create object - return new $class( $host, $user, $password, $dbname, 1, $flags ); + # Create object + return new $class( $host, $user, $password, $dbname, 1, $flags ); } function reportConnectionError( &$conn )