This is Google's cache of https://filp.github.io/whoops/. It is a snapshot of the page as it appeared on Apr 24, 2024 12:38:38 GMT. The current page could have changed in the meantime. Learn more.
Full versionText-only versionView source
Tip: To quickly find your search term on this page, press Ctrl+F or ⌘-F (Mac) and use the find bar.
whoops! - php errors for cool kids Fork me on GitHub

whoops

php errors for cool kids

whoops is a nice little library that helps you develop and maintain your projects better, by helping you deal with errors and exceptions in a less painful way.

Features

  • Includes providers for Silex and Zend Framework 2, with community-provided support for other platforms and frameworks
  • Now included in the Laravel 4 core!
  • Detailed & intuitive page for errors and exceptions (PrettyPageHandler)
  • Code view for all frames in a stack trace with line highlights (PrettyPageHandler)
  • Frame comments & analysis through custom middle-ware/handlers (PrettyPageHandler)
  • Request & app-specific information through custom middle-ware/handlers (PrettyPageHandler)
  • JSON & AJAX support (JsonResponseHandler)
  • XML & SOAP support (XmlResponsehandler, SoapResponseHandler)
  • Clean and tested code-base that's easy to extend and build on to make it work just right for your project

Download

With Composer:

{
  "require": {
    "filp/whoops": "2.*"
  }
}
$ cd my_project
$ composer install

Use

In your Silex project, register the bundled Service Provider:

$app->register(new Whoops\Provider\Silex\WhoopsServiceProvider);

For integration instructions with other frameworks or platforms, check out the README file.

Or if you'd rather take control, integrate it manually and tweak it to fit your needs:

require __DIR__ . "/vendor/autoload.php";

$run     = new \Whoops\Run;
$handler = new \Whoops\Handler\PrettyPageHandler;

// Add some custom tables with relevant info about your application,
// that could prove useful in the error page:
$handler->addDataTable('Killer App Details', array(
  "Important Data" => $myApp->getImportantData(),
  "Thingamajig-id" => $someId
));

// Set the title of the error page:
$handler->setPageTitle("Whoops! There was a problem.");

$run->pushHandler($handler);

// Add a special handler to deal with AJAX requests with an
// equally-informative JSON response. Since this handler is
// first in the stack, it will be executed before the error
// page handler, and will have a chance to decide if anything
// needs to be done.
if (\Whoops\Util\Misc::isAjaxRequest()) {
  $run->pushHandler(new \Whoops\Handler\JsonResponseHandler);
}

// Register the handler with PHP, and you're set!
$run->register();

Learn More & Contribute

API Documentation is available here. If you need any help, or want to give us a hand with the project, have a look at the repository!

whoops on github

Thank you for stopping by!