Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
franzliedke committed Oct 31, 2015
1 parent a9f178c commit b7630ee
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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;
~~~

0 comments on commit b7630ee

Please # to comment.