Exemplo n.º 1
0
Arquivo: Dao.php Projeto: LWFeng/hush
 /**
  * Get specific slave db from config file
  * 
  * @param int $cid Cluster index number
  * @param int $sid Server index number
  * @return bool
  */
 private function _getSlave($cid = null, $sid = null)
 {
     // get slave db
     $configs = array();
     if (!is_null($cid) && !is_null($sid)) {
         $configs = $this->_config->getDb($this->dbName, $cid, 'slave', $sid);
     }
     return $configs;
 }
Exemplo n.º 2
0
 /**
  * Get specific slave db from config file
  * 
  * @param int $cid Cluster index number
  * @param int $sid Server index number
  * @return bool
  */
 protected function _getSlave($cid = 0, $sid = 0)
 {
     // get slave db
     if ($cid && $sid) {
         try {
             $this->_config->getDb($this->dbName, $cid, 'slave', $sid);
         } catch (Exception $e) {
             throw new Hush_Db_Exception('Can not found slave db server');
         }
         return true;
     }
     return false;
 }