示例#1
0
文件: Pgsql.php 项目: hjr3/zf2
 /**
  * Creates a PDO object and connects to the database.
  *
  * @return void
  * @throws \Zend\DB\Adapter\Exception
  */
 protected function _connect()
 {
     if ($this->_connection) {
         return;
     }
     parent::_connect();
     if (!empty($this->_config['charset'])) {
         $sql = "SET NAMES '" . $this->_config['charset'] . "'";
         $this->_connection->exec($sql);
     }
 }
示例#2
0
文件: Mssql.php 项目: hjr3/zf2
 /**
  * @return void
  */
 protected function _connect()
 {
     if ($this->_connection) {
         return;
     }
     parent::_connect();
     $this->_connection->exec('SET QUOTED_IDENTIFIER ON');
 }