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


PHP Zend_Db_Adapter_Abstract::closeConnection方法代码示例

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


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

示例1: tearDown

 /**
  * Subclasses should call parent::tearDown() after
  * doing their own logic, e.g. deleting metadata.
  */
 public function tearDown()
 {
     if (isset($this->_util) && $this->_util->isEnabled()) {
         $this->_util->tearDown();
     }
     if ($this->_db) {
         $this->_db->closeConnection();
         $this->_db = null;
     }
 }
开发者ID:hjr3,项目名称:zf2,代码行数:14,代码来源:TestSetup.php

示例2: __call

 /**
  * Delegate to the database adapter.
  * 
  * @param string $m Method name.
  * @param array $a Method arguments.
  * @return mixed
  */
 public function __call($m, $a)
 {
     if (!method_exists($this->_adapter, $m)) {
         throw new BadMethodCallException("Method named '{$m}' does not exist or is not callable.");
     }
     // Log SQL for certain adapter calls.
     $logFor = array('fetchOne', 'fetchAll', 'prepare', 'query', 'fetchRow', 'fetchAssoc', 'fetchCol', 'fetchPairs');
     if (in_array($m, $logFor)) {
         $this->log($a[0]);
     }
     try {
         return call_user_func_array(array($this->_adapter, $m), $a);
         // Zend_Db_Statement_Mysqli does not consider a connection that returns
         // a "MySQL server has gone away" error to be disconnected. Catch these
         // errors, close the connection, and reconnect, then retry the query.
     } catch (Zend_Db_Statement_Mysqli_Exception $e) {
         if (2006 == $e->getCode()) {
             $this->_adapter->closeConnection();
             $this->_adapter->getConnection();
             return call_user_func_array(array($this->_adapter, $m), $a);
         }
         throw $e;
     }
 }
开发者ID:lchen01,项目名称:STEdwards,代码行数:31,代码来源:Db.php

示例3: close

 /**
  * Close this connection.
  *
  * @return void
  */
 public function close()
 {
     $this->_connection->closeConnection();
 }
开发者ID:fredcido,项目名称:cenbrap,代码行数:9,代码来源:Connection.php

示例4: closeConnection

 public function closeConnection()
 {
     $this->_db->closeConnection();
 }
开发者ID:schaechinger,项目名称:feader,代码行数:4,代码来源:RepositoryAbstract.php

示例5: closeConnection

 /**
  * Force the connection to close.
  *
  * @return void
  */
 public function closeConnection()
 {
     return $this->_adapter->closeConnection();
 }
开发者ID:cwcw,项目名称:cms,代码行数:9,代码来源:Abstract.php

示例6: tearDown

 public function tearDown()
 {
     $this->dropTable();
     $this->dropSequence();
     $this->_db->closeConnection();
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:6,代码来源:Common.php

示例7: tearDown

 /**
  * Subclasses should call parent::tearDown() after
  * doing their own logic, e.g. deleting metadata.
  */
 public function tearDown()
 {
     $this->_util->tearDown();
     $this->_db->closeConnection();
     $this->_db = null;
 }
开发者ID:omusico,项目名称:logica,代码行数:10,代码来源:TestSetup.php


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