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