Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/kernel/db/db_load_balancer.php
Show First 20 Lines • Show All 420 Lines • ▼ Show 20 Line(s) | |||||
* @param integer $i Server index | * @param integer $i Server index | ||||
* @return kDBConnection|false | * @return kDBConnection|false | ||||
* @access protected | * @access protected | ||||
*/ | */ | ||||
protected function &openConnection($i) | protected function &openConnection($i) | ||||
{ | { | ||||
if ( isset($this->connections[$i]) ) { | if ( isset($this->connections[$i]) ) { | ||||
$conn =& $this->connections[$i]; | $conn =& $this->connections[$i]; | ||||
$this->lastUsedIndex = $i; | |||||
} | } | ||||
else { | else { | ||||
$server = $this->servers[$i]; | $server = $this->servers[$i]; | ||||
$server['serverIndex'] = $i; | $server['serverIndex'] = $i; | ||||
$conn =& $this->reallyOpenConnection($server, $i == $this->getMasterIndex()); | $conn =& $this->reallyOpenConnection($server, $i == $this->getMasterIndex()); | ||||
if ( $conn->connectionOpened ) { | if ( $conn->connectionOpened ) { | ||||
$this->connections[$i] =& $conn; | $this->connections[$i] =& $conn; | ||||
▲ Show 20 Lines • Show All 434 Lines • Show Last 20 Lines |