コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function connect()
 {
     if (!$this->current) {
         if (!($this->current = $this->pickSlave())) {
             $this->current = $this->getMaster();
         }
     }
     $this->current->connect();
 }
コード例 #2
0
ファイル: MasterSlaveReplication.php プロジェクト: nrk/predis
 /**
  * {@inheritdoc}
  */
 public function connect()
 {
     if (!$this->current) {
         if (!($this->current = $this->pickSlave())) {
             if (!($this->current = $this->getMaster())) {
                 throw new ClientException('No available connection for replication');
             }
         }
     }
     $this->current->connect();
 }
コード例 #3
0
 /**
  * {@inheritdoc}
  */
 public function connect()
 {
     return $this->connection->connect();
 }