lucidtaz / yii2-whoops
Yii2 bindings for Whoops error handler
Installs: 17 834
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 0
Open Issues: 1
Requires
- php: >=5.6.0
- filp/whoops: ^2.1
- yiisoft/yii2: ^2.0
Requires (Dev)
- phpunit/phpunit: ^5.5
This package is auto-updated.
Last update: 2024-11-07 05:41:44 UTC
README
This library provides easy integration of filp/whoops into Yii2. Whoops is a pretty exception and error formatter. This library enables you to use it by configuring an ErrorHandler in your application config.
USAGE
Configure web.php
to disable Yii's built-in error handler and use the new one:
<?php $config = [ // ... 'components' => [ 'errorHandler' => [ 'class' => 'lucidtaz\yii2whoops\ErrorHandler', // NOTE: yii2-app-basic comes with this errorAction line by default, // be sure to comment/remove it, or you will get an // UnknownAttributeException when running your code: // 'errorAction' => 'site/error' ], // ... ], // ... ];
Or to only use it in Dev+Debug mode, to prevent your source code displaying in production:
<?php $config = [ // ... 'components' => [ 'errorHandler' => YII_ENV_DEV && YII_DEBUG ? [ 'class' => 'lucidtaz\yii2whoops\ErrorHandler', ] : [ 'class' => 'yii\web\ErrorHandler', 'errorAction' => 'site/error' ], // ... ], // ... ];