Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/franzliedke/whoops-middleware
PSR-15 compatible middleware for Whoops, the pretty error handler
https://github.com/franzliedke/whoops-middleware
middleware php psr-15 psr-7 whoops
Last synced: 3 months ago
JSON representation
PSR-15 compatible middleware for Whoops, the pretty error handler
- Host: GitHub
- URL: https://github.com/franzliedke/whoops-middleware
- Owner: franzliedke
- License: mit
- Created: 2015-06-16T23:51:05.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-02-08T21:02:01.000Z (almost 3 years ago)
- Last Synced: 2024-10-14T22:19:45.656Z (4 months ago)
- Topics: middleware, php, psr-15, psr-7, whoops
- Language: PHP
- Homepage:
- Size: 33.2 KB
- Stars: 28
- Watchers: 3
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PSR-15 middleware for Whoops
A PSR-15 compatible middleware for [Whoops](https://github.com/filp/whoops), the fantastic pretty error handler for PHP.
## Installation
You can install the library using Composer:
composer require franzl/whoops-middleware
## Usage
Assuming you are using a PSR-15 compatible middleware dispatcher (such as [zend-stratigility](https://github.com/zendframework/zend-stratigility), [Relay](http://relayphp.com/2.x), or [broker](https://github.com/northwoods/broker)), all you need to do is add the middleware class to your pipeline / broker / dispatcher ...
This might look as follows:
### Stratigility
```php
$pipe->pipe(new \Franzl\Middleware\Whoops\WhoopsMiddleware)
```### Relay
```php
$queue = [];
// ...
$queue[] = new \Franzl\Middleware\Whoops\WhoopsMiddleware;
$relay = new Relay($queue);
```### broker
```php
$broker->always(\Franzl\Middleware\Whoops\WhoopsMiddleware::class)
```