本文整理汇总了PHP中Tracy\Helpers::isAjax方法的典型用法代码示例。如果您正苦于以下问题:PHP Helpers::isAjax方法的具体用法?PHP Helpers::isAjax怎么用?PHP Helpers::isAjax使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tracy\Helpers
的用法示例。
在下文中一共展示了Helpers::isAjax方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: errorHandler
/**
* Handler to catch warnings and notices.
* @return bool FALSE to call normal error handler, NULL otherwise
* @throws ErrorException
* @internal
*/
public static function errorHandler($severity, $message, $file, $line, $context)
{
if (self::$scream) {
error_reporting(E_ALL);
}
if ($severity === E_RECOVERABLE_ERROR || $severity === E_USER_ERROR) {
if (Helpers::findTrace(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), '*::__toString')) {
$previous = isset($context['e']) && ($context['e'] instanceof \Exception || $context['e'] instanceof \Throwable) ? $context['e'] : NULL;
$e = new ErrorException($message, 0, $severity, $file, $line, $previous);
$e->context = $context;
self::exceptionHandler($e);
}
$e = new ErrorException($message, 0, $severity, $file, $line);
$e->context = $context;
throw $e;
} elseif (($severity & error_reporting()) !== $severity) {
return FALSE;
// calls normal error handler to fill-in error_get_last()
} elseif (self::$productionMode && ($severity & self::$logSeverity) === $severity) {
$e = new ErrorException($message, 0, $severity, $file, $line);
$e->context = $context;
Helpers::improveException($e);
try {
self::log($e, self::ERROR);
} catch (\Throwable $e) {
} catch (\Exception $foo) {
}
return NULL;
} elseif (!self::$productionMode && !isset($_GET['_tracy_skip_error']) && (is_bool(self::$strictMode) ? self::$strictMode : (self::$strictMode & $severity) === $severity)) {
$e = new ErrorException($message, 0, $severity, $file, $line);
$e->context = $context;
$e->skippable = TRUE;
self::exceptionHandler($e);
}
$message = 'PHP ' . Helpers::errorTypeToString($severity) . ": {$message}";
$count =& self::getBar()->getPanel('Tracy:errors')->data["{$file}|{$line}|{$message}"];
if ($count++) {
// repeated error
return NULL;
} elseif (self::$productionMode) {
try {
self::log("{$message} in {$file}:{$line}", self::ERROR);
} catch (\Throwable $e) {
} catch (\Exception $foo) {
}
return NULL;
} else {
self::fireLog(new ErrorException($message, 0, $severity, $file, $line));
return Helpers::isHtmlMode() || Helpers::isAjax() ? NULL : FALSE;
// FALSE calls normal error handler
}
}