本文整理匯總了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)');
}
}
}