Debug\ErrorHandler (Component\HttpKernel)
Symfony\Component\HttpKernel\Debug\ErrorHandler
class ErrorHandler extends ErrorHandler
ErrorHandler.
Constants
TYPE_DEPRECATION |
Methods
static ErrorHandler | register(ErrorHandler|null|int $handler = null, bool $replace = true) Registers the error handler. | from ErrorHandler |
__construct(BufferingLogger $bootstrappingLogger = null) | from ErrorHandler | |
setDefaultLogger(LoggerInterface $logger, array|int $levels = null, bool $replace = false) Sets a logger to non assigned errors levels. | from ErrorHandler | |
array | setLoggers(array $loggers) Sets a logger for each error level. | from ErrorHandler |
callable|null | setExceptionHandler(callable $handler) Sets a user exception handler. | from ErrorHandler |
int | throwAt(int $levels, bool $replace = false) Sets the PHP error levels that throw an exception when a PHP error occurs. | from ErrorHandler |
int | scopeAt(int $levels, bool $replace = false) Sets the PHP error levels for which local variables are preserved. | from ErrorHandler |
int | traceAt(int $levels, bool $replace = false) Sets the PHP error levels for which the stack trace is preserved. | from ErrorHandler |
int | screamAt(int $levels, bool $replace = false) Sets the error levels where the @-operator is ignored. | from ErrorHandler |
bool | handleError($type, $message, $file, $line, array $context, array $backtrace = null) Handles errors by filtering then logging them according to the configured bit fields. | from ErrorHandler |
handleException(Exception|Throwable $exception, array $error = null) Handles an exception by logging then forwarding it to another handler. | from ErrorHandler | |
static | handleFatalError(array $error = null) Shutdown registered function for handling PHP fatal errors. | from ErrorHandler |
static | stackErrors() Configures the error handler for delayed handling. | from ErrorHandler |
static | unstackErrors() Unstacks stacked errors and forwards to the logger. | from ErrorHandler |
setLevel(int|null $level) Sets the level at which the conversion to Exception is done. | from ErrorHandler | |
setDisplayErrors(int $displayErrors) Sets the display_errors flag value. | from ErrorHandler | |
static | setLogger(LoggerInterface $logger, string $channel = 'deprecation') Sets a logger for the given channel. | from ErrorHandler |
handle($level, $message, $file = 'unknown', $line, $context = array()) | from ErrorHandler | |
handleFatal() Handles PHP fatal errors. | from ErrorHandler |
Details
static public ErrorHandler register(ErrorHandler|null|int $handler = null, bool $replace = true)
Registers the error handler.
public __construct(BufferingLogger $bootstrappingLogger = null)
public setDefaultLogger(LoggerInterface $logger, array|int $levels = null, bool $replace = false)
Sets a logger to non assigned errors levels.
public array setLoggers(array $loggers)
Sets a logger for each error level.
public callable|null setExceptionHandler(callable $handler)
Sets a user exception handler.
public int throwAt(int $levels, bool $replace = false)
Sets the PHP error levels that throw an exception when a PHP error occurs.
public int scopeAt(int $levels, bool $replace = false)
Sets the PHP error levels for which local variables are preserved.
public int traceAt(int $levels, bool $replace = false)
Sets the PHP error levels for which the stack trace is preserved.
public int screamAt(int $levels, bool $replace = false)
Sets the error levels where the @-operator is ignored.
public bool handleError($type, $message, $file, $line, array $context, array $backtrace = null)
Handles errors by filtering then logging them according to the configured bit fields.
public handleException(Exception|Throwable $exception, array $error = null)
Handles an exception by logging then forwarding it to another handler.
static public handleFatalError(array $error = null)
Shutdown registered function for handling PHP fatal errors.
static public stackErrors()
Configures the error handler for delayed handling.
Ensures also that non-catchable fatal errors are never silenced.
As shown by http://bugs.php.net/42098 and http://bugs.php.net/60724 PHP has a compile stage where it behaves unusually. To workaround it, we plug an error handler that only stacks errors for later.
The most important feature of this is to prevent autoloading until unstackErrors() is called.
static public unstackErrors()
Unstacks stacked errors and forwards to the logger.
public setLevel(int|null $level)
Sets the level at which the conversion to Exception is done.
public setDisplayErrors(int $displayErrors)
Sets the display_errors flag value.
static public setLogger(LoggerInterface $logger, string $channel = 'deprecation')
Sets a logger for the given channel.
public handle($level, $message, $file = 'unknown', $line, $context = array())
public handleFatal()
Handles PHP fatal errors.
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.0/Symfony/Component/HttpKernel/Debug/ErrorHandler.html