whoops/silex-1

Whoops provider for Silex

Maintainers

Package info

github.com/whoops-php/silex-1

pkg:composer/whoops/silex-1

Statistics

Installs: 114 530

Dependents: 1

Suggesters: 0

Stars: 1

Open Issues: 0

1.0.1 2016-11-24 18:32 UTC

This package is auto-updated.

Last update: 2026-03-10 10:57:15 UTC


README

whoops comes packaged with a Silex Service Provider: Whoops\Provider\Silex\WhoopsServiceProvider. Using it in your existing Silex project is easy:

require 'vendor/autoload.php';

use Silex\Application;

// ... some awesome code here ...

if ($app['debug']) {
    $app->register(new Whoops\Provider\Silex\WhoopsServiceProvider());
}

// ...

$app->run();

And that's about it. By default, you'll get the pretty error pages if something goes awry in your development environment, but you also have full access to the whoops library, obviously. For example, adding a new handler into your app is as simple as extending whoops:

$app['whoops'] = $app->extend('whoops', function ($whoops) {
    $whoops->pushHandler(new DeleteWholeProjectHandler());
    return $whoops;
});