From b7630ee687a6f49192b6b56d4795d36000120cd7 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Sat, 31 Oct 2015 12:25:43 +0100 Subject: [PATCH] Update README --- README.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c273722..b7d5c4f 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,6 @@ A PSR-7 compatible middleware for [Whoops](https://github.com/filp/whoops), the fantastic pretty error handler for PHP. -*Right now, this is only compatible with Zend's Stratigility middleware pipe.* - ## Installation You can install the library using Composer: @@ -12,10 +10,20 @@ You can install the library using Composer: ## Usage -To use it, pipe your app through the middleware: +### Zend Stratigility + +If you're using Zend's Stratigility middleware pipe, you need to use the special error middleware to be able to handle exceptions: ~~~php -$app->pipe(new \Franzl\Middleware\Whoops\Middleware); +$app->pipe(new \Franzl\Middleware\Whoops\ErrorMiddleware); ~~~ (You should probably do this at the end of your middleware stack, so that errors cannot be handled elsewhere.) + +### Relay and others + +Add the standard middleware to the queue: + +~~~php +$queue[] = new \Franzl\Middleware\Whoops\Middleware; +~~~