本文整理汇总了PHP中Whoops\Util\Misc::isLevelFatal方法的典型用法代码示例。如果您正苦于以下问题:PHP Misc::isLevelFatal方法的具体用法?PHP Misc::isLevelFatal怎么用?PHP Misc::isLevelFatal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Whoops\Util\Misc
的用法示例。
在下文中一共展示了Misc::isLevelFatal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handleShutdown
/**
* Special case to deal with Fatal errors and the like.
*/
public function handleShutdown()
{
// If we reached this step, we are in shutdown handler.
// An exception thrown in a shutdown handler will not be propagated
// to the exception handler. Pass that information along.
$this->canThrowExceptions = false;
$error = error_get_last();
if ($error && Misc::isLevelFatal($error['type'])) {
// If there was a fatal error,
// it was not handled in handleError yet.
$this->handleError($error['type'], $error['message'], $error['file'], $error['line']);
}
}
示例2: getTrace
/**
* Gets the backgrace from an exception.
*
* If xdebug is installed
*
* @param Exception $e
* @return array
*/
protected function getTrace(\Exception $e)
{
$traces = $e->getTrace();
// Get trace from xdebug if enabled, failure exceptions only trace to the shutdown handler by default
if (!$e instanceof \ErrorException) {
return $traces;
}
if (!Misc::isLevelFatal($e->getSeverity())) {
return $traces;
}
if (!extension_loaded('xdebug') || !xdebug_is_enabled()) {
return array();
}
// Use xdebug to get the full stack trace and remove the shutdown handler stack trace
$stack = array_reverse(xdebug_get_function_stack());
$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
$traces = array_diff_key($stack, $trace);
return $traces;
}