本文整理汇总了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;
}
}
示例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;
}
}
示例3: close
/**
* Close this connection.
*
* @return void
*/
public function close()
{
$this->_connection->closeConnection();
}
示例4: closeConnection
public function closeConnection()
{
$this->_db->closeConnection();
}
示例5: closeConnection
/**
* Force the connection to close.
*
* @return void
*/
public function closeConnection()
{
return $this->_adapter->closeConnection();
}
示例6: tearDown
public function tearDown()
{
$this->dropTable();
$this->dropSequence();
$this->_db->closeConnection();
}
示例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;
}