class ErrorHandler extends ErrorHandler
deprecated
ErrorHandler.
TYPE_DEPRECATION |
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) deprecated Sets the level at which the conversion to Exception is done. | from ErrorHandler | |
setDisplayErrors(int $displayErrors) deprecated Sets the display_errors flag value. | from ErrorHandler | |
static | setLogger(LoggerInterface $logger, string $channel = 'deprecation') deprecated Sets a logger for the given channel. | from ErrorHandler |
handle($level, $message, $file = 'unknown', $line, $context = array()) deprecated | from ErrorHandler | |
handleFatal() deprecated Handles PHP fatal errors. | from ErrorHandler |
Registers the error handler.
ErrorHandler|null|int | $handler | The handler to register, or @deprecated (since version 2.6, to be removed in 3.0) bit field of thrown levels |
bool | $replace | Whether to replace or not any existing handler |
ErrorHandler | The registered error handler |
BufferingLogger | $bootstrappingLogger |
Sets a logger to non assigned errors levels.
LoggerInterface | $logger | A PSR-3 logger to put as default for the given levels |
array|int | $levels | An array map of E* to LogLevel::* or an integer bit field of E* constants |
bool | $replace | Whether to replace or not any existing logger |
Sets a logger for each error level.
array | $loggers | Error levels to [LoggerInterface|null, LogLevel::*] map |
array | The previous map |
InvalidArgumentException |
Sets a user exception handler.
callable | $handler | A handler that will be called on Exception |
callable|null | The previous exception handler |
InvalidArgumentException |
Sets the PHP error levels that throw an exception when a PHP error occurs.
int | $levels | A bit field of E_* constants for thrown errors |
bool | $replace | Replace or amend the previous value |
int | The previous value |
Sets the PHP error levels for which local variables are preserved.
int | $levels | A bit field of E_* constants for scoped errors |
bool | $replace | Replace or amend the previous value |
int | The previous value |
Sets the PHP error levels for which the stack trace is preserved.
int | $levels | A bit field of E_* constants for traced errors |
bool | $replace | Replace or amend the previous value |
int | The previous value |
Sets the error levels where the @-operator is ignored.
int | $levels | A bit field of E_* constants for screamed errors |
bool | $replace | Replace or amend the previous value |
int | The previous value |
Handles errors by filtering then logging them according to the configured bit fields.
$type | ||
$message | ||
$file | ||
$line | ||
array | $context | |
array | $backtrace |
bool | Returns false when no handling happens so that the PHP engine can handle the error itself. |
ErrorException | When $this->thrownErrors requests so |
Handles an exception by logging then forwarding it to another handler.
Exception|Throwable | $exception | An exception to handle |
array | $error | An array as returned by errorgetlast() |
Shutdown registered function for handling PHP fatal errors.
array | $error | An array as returned by errorgetlast() |
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.
Unstacks stacked errors and forwards to the logger.
deprecated
Sets the level at which the conversion to Exception is done.
int|null | $level | The level (null to use the error_reporting() value and 0 to disable) |
deprecated
Sets the display_errors flag value.
int | $displayErrors | The display_errors flag value |
deprecated
Sets a logger for the given channel.
LoggerInterface | $logger | A logger interface |
string | $channel | The channel associated with the logger (deprecation, emergency or scream) |
deprecated
$level | ||
$message | ||
$file | ||
$line | ||
$context |
deprecated
Handles PHP fatal errors.
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/4.0/Symfony/Component/HttpKernel/Debug/ErrorHandler.html