本文整理匯總了PHP中error::fullHalt方法的典型用法代碼示例。如果您正苦於以下問題:PHP error::fullHalt方法的具體用法?PHP error::fullHalt怎麽用?PHP error::fullHalt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類error
的用法示例。
在下文中一共展示了error::fullHalt方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
public function __construct()
{
$this->error = new Error();
$this->user = 'root';
$this->pass = 'ieDEk4QaiKjNOsou';
$this->host = 'localhost';
$this->target_db = 'piercemoore';
try {
if (!$this->_connect(true)) {
throw new Exception("Connection to '{$this->host}' failed. Error: " . self::getError());
}
if (!$this->_select($this->target_db)) {
throw new Exception("Connection to database '{$this->target_db}' failed. Error: " . self::getError());
}
} catch (Exception $e) {
error::fullHalt($e->getMessage(), __FUNCTION__, __LINE__);
}
}
示例2: deleteIPBlock
public function deleteIPBlock($start_ip, $type = 'block')
{
list($start_ip, $type) = db::prepare(func_get_args());
$ip_type = self::getIPType($start_ip);
$start_ip = self::ipToLong($start_ip);
switch ($type) {
case 'block':
$table = 'ip_blocks';
break;
case 'allocation':
$table = 'allocations';
break;
default:
$table = 'ip_blocks';
break;
}
$sql = "DELETE FROM {$table} WHERE `starting_ip` = '{$start_ip}'";
try {
if (!($q = db::query($sql, 1, 1))) {
throw new exception("Unable to delete IPv{$ip_type} block '" . self::longToIP($start_ip) . "'. MySQL reports: " . db::getError());
} else {
return true;
}
} catch (exception $e) {
error::fullHalt($e->getMessage(), __FUNCTION__, __LINE__);
}
return false;
}