本文整理汇总了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;
}