本文整理汇总了PHP中Sintattica\Atk\Core\Tools::atkhalt方法的典型用法代码示例。如果您正苦于以下问题:PHP Tools::atkhalt方法的具体用法?PHP Tools::atkhalt怎么用?PHP Tools::atkhalt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sintattica\Atk\Core\Tools
的用法示例。
在下文中一共展示了Tools::atkhalt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: filter_request_where_clause
/**
* Filter a request variable, containing a WHERE clause, from the globals
* if it is blacklisted.
*
* @param string $variable
*
* @example filter_request_where_clause('atkselector')
*/
public static function filter_request_where_clause($variable)
{
if (isset($_REQUEST[$variable])) {
$values = (array) $_REQUEST[$variable];
foreach ($values as $value) {
$checker = new self($value);
if (!$checker->isSafe()) {
Tools::atkhalt('Unsafe WHERE clause in REQUEST variable: ' . $variable, 'critical');
}
}
}
}
示例2: halt
/**
* If haltonerror is set, this will raise an atkerror. If not, it will
* place the error in atkdebug and continue.
*
* @param string $message
*/
public function halt($message = '')
{
if ($this->m_haltonerror) {
if ($this->getErrorType() === 'system') {
Tools::atkdebug(__CLASS__ . '::halt() on system error');
$level = 'warning';
if (!in_array($this->m_errno, $this->m_user_error)) {
$level = 'critical';
}
Tools::atkerror($this->getErrorMsg());
Tools::atkhalt($this->getErrorMsg(), $level);
} else {
Tools::atkdebug(__CLASS__ . '::halt() on user error (not halting)');
}
}
}