2017 © Pedro Peláez
 

library yii2-whoops

Yii2 bindings for Whoops error handler

image

lucidtaz/yii2-whoops

Yii2 bindings for Whoops error handler

  • Saturday, October 1, 2016
  • by LucidTaZ
  • Repository
  • 1 Watchers
  • 2 Stars
  • 1,926 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 34 % Grown

The README.md

Yii2 bindings for Whoops

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., (*1)

USAGE

Configure web.php to disable Yii's built-in error handler and use the new one:, (*2)

<?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:, (*3)

<?php
$config = [
    // ...
    'components' => [
        'errorHandler' => YII_ENV_DEV && YII_DEBUG ? [
            'class' => 'lucidtaz\yii2whoops\ErrorHandler',
        ] : [
            'class' => 'yii\web\ErrorHandler',
            'errorAction' => 'site/error'
        ],
        // ...
    ],
    // ...
];

The Versions

01/10 2016

dev-master

9999999-dev

Yii2 bindings for Whoops error handler

  Sources   Download

MIT

The Requires

 

The Development Requires

by Thijs Zumbrink