nkovacs / yii-whoops
Whoops integration class for Yii Framework 1.1
Requires
- filp/whoops: 1.*
- yiisoft/yii: 1.1.*
This package is auto-updated.
Last update: 2024-10-25 03:19:56 UTC
README
Integrates the Whoops library into Yii 1.1.
This error handler replaces the built-in exception views with Whoops.
Your error action (or Yii's built-in error views, if errorAction is not set)
is used if your application is not in debug mode (i.e. YII_DEBUG
is false), or the
exception is a CHttpException
.
Usage
-
Install it:
- Using Composer (it will automatically install Whoops main libraries as well):
composer require igorsantos07/yii-whoops:1 composer install
- Or downloading and unpacking it in your
extensions
folder.
-
If you're using Composer, I strongly recomend you create a
vendor
alias if you haven't yet. Add this to the beginning of yourconfig/main.php
:Yii::setPathOfAlias('vendor', __DIR__.'/../../vendor');
-
Replace your
errorHandler
entry atconfig/main.php
with the error handler class. Example:'errorHandler' => ['class' => 'vendor.nkovacs.yii-whoops.WhoopsErrorHandler']
If you're using Composer's autoloader, you can simply use
'WhoopsErrorHandler'
. You must require 'vendor/autoload.php' in your entry scripts (index.php, yiic.php etc.) for this to work. -
If you're using some custom LogRoute that binds to the application's end, you can disable it using the component's
disabledLogRoutes
property. Just set it to an array containing all the classnames (not aliases!) of each route you want disabled whenever Whoops is launched. By default it disables the famous Yii Debug Toolbar; if you want to keep it enabled, override thedefaultDisabledLogRoutes
property.'errorHandler' => [ 'class' => 'vendor.nkovacs.yii-whoops.WhoopsErrorHandler', 'disabledLogRoutes' => 'MyCustomRouteClass' ]