當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。