Download the PHP package davidecesarano/embryo-error without Composer
On this page you can find all versions of the php package davidecesarano/embryo-error. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download davidecesarano/embryo-error
More information about davidecesarano/embryo-error
Files in davidecesarano/embryo-error
Package embryo-error
Short Description PSR-15 middleware to handle errors.
License MIT
Homepage https://github.com/davidecesarano/embryo-error
Informations about the package embryo-error
Embryo Error
PSR-15 middleware to handle errors. This handler inspired by Slim. It receives all uncaught PHP exceptions and converts them to a new HTTP response with the status code.
Requirements
- PHP >= 7.1
- A PSR-7 http message implementation and PSR-17 http factory implementation (ex. Embryo-Http)
- A PSR-15 http server request handlers implementation (ex. Embryo-Middleware)
- A PSR response emitter (ex. Embryo-Emitter)
Install
Using Composer:
Usage
You may quickly test this using the built-in PHP server going to http://localhost:8000.
Options
__construct(bool $displayDetails = true, bool $logErrors = true)
The error handler includes detailed information on error diagnostics and saving to a log file. To enable this you need to set the displayDetails and logErrors setting to true.
setLogger(LoggerInterface $logger)
You must set a PSR logger if logErrors is set to true.
setRenderer(ErrorRendererInterface $renderer = null, Throwable $exception)
You can set up a custom renderer for printing errors.
All versions of embryo-error with dependencies
davidecesarano/embryo-http Version dev-master
davidecesarano/embryo-middleware Version dev-master
davidecesarano/embryo-logger Version dev-master
davidecesarano/embryo-emitter Version dev-master