You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
10 years ago | |
|---|---|---|
| .. | ||
| examples | 10 years ago | |
| src/Zeuxisoo/Whoops/Provider/Slim | 10 years ago | |
| tests | 10 years ago | |
| .gitignore | 10 years ago | |
| .travis.yml | 10 years ago | |
| Makefile | 10 years ago | |
| README.md | 10 years ago | |
| codeception.yml | 10 years ago | |
| composer.json | 10 years ago | |
| phpunit.xml.dist | 10 years ago | |
README.md
Slim whoops
PHP whoops error on slim framework
Status
Installation
Install the composer
curl -sS https://getcomposer.org/installer | php
Edit composer.json
| Slim | Whoops | Middleware |
|---|---|---|
| 1 | n/a | 0.1.* |
| 2 | 1.* | 0.3.* |
| 3 | <= 1.* | 0.4.* |
| 3 | >= 2.* | 0.5.* |
For Slim framework 3, The composer.json will looks like
{
"require": {
"zeuxisoo/slim-whoops": "0.5.*"
}
}
Now, install or update the dependencies
php composer.phar install
Usage
Just need to add the middleware in your slim application.
Simple way
In this case, You must ensure this line is first added and on top of other middlewares
$app->add(new \Zeuxisoo\Whoops\Provider\Slim\WhoopsMiddleware);
$app->add(new \Other\MiddlewareA);
$app->add(new \Other\MiddlewareB);
Better DI
In this case, You can place this line anywhere no position required
$app->add(new \Zeuxisoo\Whoops\Provider\Slim\WhoopsMiddleware($app));
Options
Opening referenced files with your favorite editor or IDE
$app = new App([
'settings' => [
// Enable whoops
'debug' => true,
// Support click to open editor
'whoops.editor' => 'sublime',
// Display call stack in orignal slim error when debug is off
'displayErrorDetails' => true,
]
]);
Important Note
Version 0.3.0
- The
whoopslibrary is installed by default base on the Whoops Framework Integration Document
Version 0.2.0
- You must to install the
whoopslibrary manually.
Testing
Run the test cases
php vendor/bin/phpunit
