本文整理汇总了PHP中DBFactory::reset_db_connection方法的典型用法代码示例。如果您正苦于以下问题:PHP DBFactory::reset_db_connection方法的具体用法?PHP DBFactory::reset_db_connection怎么用?PHP DBFactory::reset_db_connection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBFactory
的用法示例。
在下文中一共展示了DBFactory::reset_db_connection方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check_db_connection
public function check_db_connection($host, $port, $login, $password, &$database, $tables_prefix)
{
try {
$this->try_db_connection($host, $port, $login, $password, $database, $tables_prefix);
} catch (UnexistingDatabaseException $ex) {
if (!$this->create_database($database)) {
DBFactory::reset_db_connection();
return self::UNABLE_TO_CREATE_DATABASE;
} else {
return $this->check_db_connection($host, $port, $login, $password, $database, $tables_prefix);
}
} catch (DBConnectionException $ex) {
DBFactory::reset_db_connection();
return self::CONNECTION_ERROR;
} catch (Exception $ex) {
DBFactory::reset_db_connection();
return self::UNKNOWN_ERROR;
}
return self::CONNECTION_SUCCESSFUL;
}
示例2: check_db_connection
public function check_db_connection($host, $port, $login, $password, &$database, $tables_prefix)
{
try {
$this->try_db_connection($host, $port, $login, $password, $database, $tables_prefix);
} catch (UnexistingDatabaseException $ex) {
DBFactory::reset_db_connection();
return self::UNEXISTING_DATABASE;
} catch (DBConnectionException $ex) {
DBFactory::reset_db_connection();
return self::CONNECTION_ERROR;
} catch (Exception $ex) {
DBFactory::reset_db_connection();
return self::UNKNOWN_ERROR;
}
return self::CONNECTION_SUCCESSFUL;
}