本文整理汇总了PHP中error::log方法的典型用法代码示例。如果您正苦于以下问题:PHP error::log方法的具体用法?PHP error::log怎么用?PHP error::log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类error
的用法示例。
在下文中一共展示了error::log方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: table
public static function table($table)
{
$q = \maverick\query::getInstance(true);
if (!strlen($table)) {
error::log('Table not specified', true);
} else {
$q->set_from_table($table);
}
return $q;
}
示例2: createNewIPBlock
public function createNewIPBlock($start_ip, $size)
{
list($start_ip, $size) = db::prepare(func_get_args());
$type = self::getIPType($start_ip);
$ending_ip = self::ipToLong(self::findEndOfIPBlock($start_ip, $size));
$start_ip = self::ipToLong(self::expandIP($start_ip));
$hr_start = self::longToIP($start_ip);
$hr_end = self::longToIP($ending_ip);
try {
if (!self::ipBlockFree($start_ip, $ending_ip, $type)) {
throw new exception('IP block already exists in database. Unable to create block.');
} else {
if ($start_ip == '' || $ending_ip == '' || $type == '') {
throw new exception('One or more arguments is empty, and the query cannot be run.');
}
$num_size = self::countIPsInBlock($size, $type);
$date = date(CURRENT_DATE_FORMAT);
$sql = "INSERT INTO `ip_blocks` \n\t\t\t\t\t\t\t(\t`starting_ip`,\n\t\t\t\t\t\t\t\t`ending_ip`,\n\t\t\t\t\t\t\t\t`hr_start`,\n\t\t\t\t\t\t\t\t`hr_end`,\n\t\t\t\t\t\t\t\t`ip_type`,\n\t\t\t\t\t\t\t\t`block_size`,\n\t\t\t\t\t\t\t\t`created_on`\n\t\t\t\t\t\t\t) VALUES\n\t\t\t\t\t\t\t(\t'{$start_ip}',\n\t\t\t\t\t\t\t\t'{$ending_ip}',\n\t\t\t\t\t\t\t\t'{$hr_start}',\n\t\t\t\t\t\t\t\t'{$hr_end}',\n\t\t\t\t\t\t\t\t'{$type}',\n\t\t\t\t\t\t\t\t'{$num_size}',\n\t\t\t\t\t\t\t\t'{$date}'\n\t\t\t\t\t\t\t)";
if (db::query($sql, null, 1)) {
error::log("New IPv{$type} block '{$hr_start}{$size}' created, range: {$hr_start} - {$hr_end}.");
return true;
} else {
throw new Exception("IP block starting with IP {$start_ip} unable to be created.");
}
}
} catch (Exception $e) {
error::log($e->getMessage(), __FUNCTION__, __LINE__);
}
return false;
}
示例3: fullHalt
public function fullHalt($message, $function = null, $line = null)
{
if (!error::log($message, $function, $line, 1)) {
die($message);
}
}