/var
/www
/vendor
/filp
/whoops
/src
/Whoops
/Exception
/Inspector.php
*
* If xdebug is installed
*
* @param \Throwable $e
* @return array
*/
protected function getTrace($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 [];
}
// 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;
}
/**
* Given an exception, generates an array in the format
* generated by Exception::getTrace()
* @param \Throwable $exception
* @return array
*/
protected function getFrameFromException($exception)
{
return [
Arguments
"""
Uncaught Error: Call to undefined function Whoops\Exception\xdebug_is_enabled() in /var/www/vendor/filp/whoops/src/Whoops/Exception/Inspector.php:254\n
Stack trace:\n
#0 /var/www/vendor/filp/whoops/src/Whoops/Exception/Inspector.php(175): Whoops\Exception\Inspector->getTrace(Object(Symfony\Component\Debug\Exception\FatalThrowableError))\n
#1 /var/www/vendor/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php(264): Whoops\Exception\Inspector->getFrames()\n
#2 /var/www/vendor/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php(181): Whoops\Handler\PrettyPageHandler->getExceptionFrames()\n
#3 /var/www/vendor/filp/whoops/src/Whoops/Run.php(272): Whoops\Handler\PrettyPageHandler->handle(Object(Symfony\Component\Debug\Exception\FatalThrowableError))\n
#4 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(339): Whoops\Run->handleException(Object(Symfony\Component\Debug\Exception\FatalThrowableError))\n
#5 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(313): Ill
"""
/var
/www
/vendor
/laravel
/framework
/src
/Illuminate
/Foundation
/Bootstrap
/HandleExceptions.php
* @return void
*/
public function handleShutdown()
{
if (! is_null($error = error_get_last()) && $this->isFatal($error['type'])) {
$this->handleException($this->fatalExceptionFromError($error, 0));
}
}
/**
* Create a new fatal exception instance from an error array.
*
* @param array $error
* @param int|null $traceOffset
* @return \Symfony\Component\Debug\Exception\FatalErrorException
*/
protected function fatalExceptionFromError(array $error, $traceOffset = null)
{
return new FatalErrorException(
$error['message'], $error['type'], 0, $error['file'], $error['line'], $traceOffset
);
}
/**
* Determine if the error type is fatal.
*
* @param int $type
* @return bool
*/
protected function isFatal($type)
{
return in_array($type, [E_COMPILE_ERROR, E_CORE_ERROR, E_ERROR, E_PARSE]);
}
/**
* Get an instance of the exception handler.
*
* @return \Illuminate\Contracts\Debug\ExceptionHandler
*/
protected function getExceptionHandler()
Arguments
"'Uncaught Error: Call to undefined function Whoops\\Exception\\xdebug_is_enabled() in /var/www/vendor/filp/whoops/src/Whoops/Exception/Inspector.php:254\nStack trace:\n#0 /var/www/vendor/filp/whoops/src/Whoops/Exception/Inspector.php(175): Whoops\\Exception\\Inspector->getTrace(Object(Symfony\\Component\\Debug\\Exception\\FatalThrowableError))\n#1 /var/www/vendor/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php(264): Whoops\\Exception\\Inspector->getFrames()\n#2 /var/www/vendor/filp/whoops/src/Whoops/Handler/PrettyPag'..."
"1"
"0"
"'/var/www/vendor/filp/whoops/src/Whoops/Exception/Inspector.php'"
"254"
"0"
"???"
"???"
"???"
/var
/www
/vendor
/laravel
/framework
/src
/Illuminate
/Foundation
/Bootstrap
/HandleExceptions.php
/**
* Render an exception as an HTTP response and send it.
*
* @param \Exception $e
* @return void
*/
protected function renderHttpResponse(Exception $e)
{
$this->getExceptionHandler()->render($this->app['request'], $e)->send();
}
/**
* Handle the PHP shutdown event.
*
* @return void
*/
public function handleShutdown()
{
if (! is_null($error = error_get_last()) && $this->isFatal($error['type'])) {
$this->handleException($this->fatalExceptionFromError($error, 0));
}
}
/**
* Create a new fatal exception instance from an error array.
*
* @param array $error
* @param int|null $traceOffset
* @return \Symfony\Component\Debug\Exception\FatalErrorException
*/
protected function fatalExceptionFromError(array $error, $traceOffset = null)
{
return new FatalErrorException(
$error['message'], $error['type'], 0, $error['file'], $error['line'], $traceOffset
);
}
/**
* Determine if the error type is fatal.
*
Arguments
"['type' => 1, 'message' => 'Uncaught Error: Call to undefined function Whoops\\Exception\\xdebug_is_enabled() in /var/www/vendor/filp/whoops/src/Whoops/Exception/Inspector.php:254\nStack trace:\n#0 /var/www/vendor/filp/whoops/src/Whoops/Exception/Inspector.php(175): Whoops\\Exception\\Inspector->getTrace(Object(Symfony\\Component\\Debug\\Exception\\FatalThrowableError))\n#1 /var/www/vendor/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php(264): Whoops\\Exception\\Inspector->getFrames()\n#2 /var/www/vendor/filp/whoops/src/Whoops/Handler/PrettyPag'..., 'file' => '/var/www/vendor/filp/whoops/src/Whoops/Exception/Inspector.php', 'line' => 254]"
"0"
/var
/www
/vendor
/laravel
/framework
/src
/Illuminate
/Foundation
/Bootstrap
/HandleExceptions.php
<?php
namespace Illuminate\Foundation\Bootstrap;
use Exception;
use ErrorException;
use Illuminate\Contracts\Debug\ExceptionHandler;
use Illuminate\Contracts\Foundation\Application;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Debug\Exception\FatalErrorException;
use Symfony\Component\Debug\Exception\FatalThrowableError;
class HandleExceptions
{
/**
* The application instance.
*
* @var \Illuminate\Contracts\Foundation\Application
*/
protected $app;
/**
* Bootstrap the given application.
*
* @param \Illuminate\Contracts\Foundation\Application $app
* @return void
*/
public function bootstrap(Application $app)
{
$this->app = $app;
error_reporting(-1);
set_error_handler([$this, 'handleError']);
set_exception_handler([$this, 'handleException']);
register_shutdown_function([$this, 'handleShutdown']);
if (! $app->environment('testing')) {