alimiracle 24e7577a47 make all | 9 anni fa | |
---|---|---|
.. | ||
docs | 9 anni fa | |
examples | 9 anni fa | |
src | 9 anni fa | |
tests | 9 anni fa | |
.gitignore | 9 anni fa | |
.scrutinizer.yml | 9 anni fa | |
.travis.yml | 9 anni fa | |
CONTRIBUTING.md | 9 anni fa | |
LICENSE.md | 9 anni fa | |
README.md | 9 anni fa | |
composer.json | 9 anni fa | |
phpunit.xml.dist | 9 anni fa |
php errors for cool kids
whoops is an error handler base/framework for PHP. Out-of-the-box, it provides a pretty error interface that helps you debug your web projects, but at heart it's a simple yet powerful stacked error handling system.
If you use Laravel 4, you already have Whoops. There are also community-provided instructions on how to integrate Whoops into Silex, Phalcon, Laravel 3, CakePHP, Zend Framework 2, Yii 1.
If you are not using any of these frameworks, here's a very simple way to install:
Use Composer to install Whoops into your project:
composer require filp/whoops:1
Register the pretty handler in your code:
$whoops = new \Whoops\Run;
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
$whoops->register();
For more options, have a look at the example files in examples/
to get a feel for how things work. Also take a look at the API Documentation and the list of available handers below.
whoops currently ships with the following built-in handlers, available in the Whoops\Handler
namespace:
PrettyPageHandler
- Shows a pretty error page when something goes pants-upCallbackHandler
- Wraps a closure or other callable as a handler. You do not need to use this handler explicitly, whoops will automatically wrap any closure or callable you pass to Whoops\Run::pushHandler
JsonResponseHandler
- Captures exceptions and returns information on them as a JSON string. Can be used to, for example, play nice with AJAX requests.XmlResponseHandler
- Captures exceptions and returns information on them as a XML string. Can be used to, for example, play nice with AJAX requests.SoapResponseHandler
- Captures exceptions and returns information on them as a SOAP string. Might be used for SOAP Webservices.This library was primarily developed by Filipe Dobreira, and is currently maintained by Denis Sokolov. A lot of awesome fixes and enhancements were also sent in by various contributors.