当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Db_Adapter_Pdo_Abstract::_connect方法代码示例

本文整理汇总了PHP中Zend_Db_Adapter_Pdo_Abstract::_connect方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Db_Adapter_Pdo_Abstract::_connect方法的具体用法?PHP Zend_Db_Adapter_Pdo_Abstract::_connect怎么用?PHP Zend_Db_Adapter_Pdo_Abstract::_connect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Db_Adapter_Pdo_Abstract的用法示例。


在下文中一共展示了Zend_Db_Adapter_Pdo_Abstract::_connect方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _connect

 /**
  * @return void
  */
 protected function _connect()
 {
     if ($this->_connection) {
         return;
     }
     parent::_connect();
     $this->_connection->exec('SET QUOTED_IDENTIFIER ON');
 }
开发者ID:BackupTheBerlios,项目名称:ajnet,代码行数:11,代码来源:Mssql.php

示例2: _connect

 /**
  * 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);
     }
 }
开发者ID:H38uS,项目名称:Impulsion,代码行数:17,代码来源:Pgsql.php

示例3: _connect

 /**
  * Creates a PDO object and connects to the database.
  *
  * @return void
  * @throws Zend_Db_Adapter_Exception
  */
 protected function _connect()
 {
     if ($this->_connection) {
         return;
     }
     if (!empty($this->_config['charset'])) {
         $initCommand = "SET NAMES '" . $this->_config['charset'] . "'";
         $this->_config['driver_options'][PDO::MYSQL_ATTR_INIT_COMMAND] = $initCommand;
     }
     parent::_connect();
 }
开发者ID:H38uS,项目名称:Impulsion,代码行数:17,代码来源:Mysql.php

示例4: _connect

 /**
  * Creates a PDO object and connects to the database.
  *
  * @return void
  * @throws Zend_Db_Adapter_Exception
  */
 protected function _connect()
 {
     if ($this->_connection) {
         return;
     }
     if (!empty($this->_config['charset']) && version_compare(PHP_VERSION, '5.3.6', '<')) {
         $initCommand = "SET NAMES '" . $this->_config['charset'] . "'";
         $this->_config['driver_options'][1002] = $initCommand;
         // 1002 = PDO::MYSQL_ATTR_INIT_COMMAND
     }
     parent::_connect();
 }
开发者ID:janpolsen,项目名称:zend-db,代码行数:18,代码来源:Mysql.php

示例5: _connect

 /**
  * 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();
     /**
              * Mantis #0009452 - This feature was disable for making possible to enable transaction pooling
             if (!empty($this->_config['charset'])) {
                 $sql = "SET NAMES '" . $this->_config['charset'] . "'";
                 $this->_connection->exec($sql);
             }
             **/
 }
开发者ID:bitExpert,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:20,代码来源:Pgsql.php

示例6: _connect

 /**
  * Creates a PDO object and connects to the database.
  *
  * The IBM data server is set.
  * Current options are DB2 or IDS
  * @todo also differentiate between z/OS and i/5
  *
  * @return void
  * @throws Zend_Db_Adapter_Exception
  */
 public function _connect()
 {
     if ($this->_connection) {
         return;
     }
     parent::_connect();
     $this->getConnection()->setAttribute(Zend_Db::ATTR_STRINGIFY_FETCHES, true);
     try {
         if ($this->_serverType === null) {
             $server = substr($this->getConnection()->getAttribute(PDO::ATTR_SERVER_INFO), 0, 3);
             switch ($server) {
                 case 'DB2':
                     $this->_serverType = new Zend_Db_Adapter_Pdo_Ibm_Db2($this);
                     // Add DB2-specific numeric types
                     $this->_numericDataTypes['DECFLOAT'] = Zend_Db::FLOAT_TYPE;
                     $this->_numericDataTypes['DOUBLE'] = Zend_Db::FLOAT_TYPE;
                     $this->_numericDataTypes['NUM'] = Zend_Db::FLOAT_TYPE;
                     break;
                 case 'IDS':
                     $this->_serverType = new Zend_Db_Adapter_Pdo_Ibm_Ids($this);
                     // Add IDS-specific numeric types
                     $this->_numericDataTypes['SERIAL'] = Zend_Db::INT_TYPE;
                     $this->_numericDataTypes['SERIAL8'] = Zend_Db::BIGINT_TYPE;
                     $this->_numericDataTypes['INT8'] = Zend_Db::BIGINT_TYPE;
                     $this->_numericDataTypes['SMALLFLOAT'] = Zend_Db::FLOAT_TYPE;
                     $this->_numericDataTypes['MONEY'] = Zend_Db::FLOAT_TYPE;
                     break;
             }
         }
     } catch (PDOException $e) {
         /** @see Zend_Db_Adapter_Exception */
         require_once 'Zend/Db/Adapter/Exception.php';
         $error = strpos($e->getMessage(), 'driver does not support that attribute');
         if ($error) {
             throw new Zend_Db_Adapter_Exception("PDO_IBM driver extension is downlevel.  Please use driver release version 1.2.1 or later", 0, $e);
         } else {
             throw new Zend_Db_Adapter_Exception($e->getMessage(), $e->getCode(), $e);
         }
     }
 }
开发者ID:mehulsbhatt,项目名称:hashmark,代码行数:50,代码来源:Ibm.php

示例7: _connect

 /**
  * Special configuration for SQLite behavior: make sure that result sets
  * contain keys like 'column' instead of 'table.column'.
  *
  * @throws Zend_Db_Adapter_Exception
  */
 protected function _connect()
 {
     /**
      * if we already have a PDO object, no need to re-connect.
      */
     if ($this->_connection) {
         return;
     }
     parent::_connect();
     $retval = $this->_connection->exec('PRAGMA full_column_names=0');
     if ($retval === false) {
         $error = $this->_connection->errorInfo();
         /** @see Zend_Db_Adapter_Exception */
         require_once 'Zend/Db/Adapter/Exception.php';
         throw new Zend_Db_Adapter_Exception($error[2]);
     }
     $retval = $this->_connection->exec('PRAGMA short_column_names=1');
     if ($retval === false) {
         $error = $this->_connection->errorInfo();
         /** @see Zend_Db_Adapter_Exception */
         require_once 'Zend/Db/Adapter/Exception.php';
         throw new Zend_Db_Adapter_Exception($error[2]);
     }
 }
开发者ID:Sywooch,项目名称:forums,代码行数:30,代码来源:Sqlite.php


注:本文中的Zend_Db_Adapter_Pdo_Abstract::_connect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。