Beispiel #1
0
 /**
  * 获取SlaveDB连接
  */
 protected function _getSlaveDB()
 {
     if (null == $this->_oSlaveDB) {
         $iStartTime = microtime(true);
         if ($this->_bStrictMaster) {
             $this->_oSlaveDB = Util_Common::getDb($this->_sDbName, 'master');
         } else {
             $this->_oSlaveDB = Util_Common::getDb($this->_sDbName, 'salve');
         }
         self::$_iConnentTime += round((microtime(true) - $iStartTime) * 1000, 2);
     }
     return $this->_oSlaveDB;
 }