mirror of
https://github.com/filp/whoops.git
synced 2026-09-04 22:48:11 +00:00
Remove Illuminate provider (yay)
This commit is contained in:
@@ -18,7 +18,6 @@ powerful stacked error handling system.
|
||||
- Simple API for dealing with exceptions, trace frames & their data
|
||||
- Includes a pretty rad error page for your webapp projects
|
||||
- Includes a `Silex\WhoopsServiceProvider` for painless integration with [Silex](http://silex.sensiolabs.org/)
|
||||
- Includes an `Illuminate\WhoopsServiceProvider` for equally painless integration with [Laravel 4](http://laravel.com/)
|
||||
- Easy to extend and integrate with existing libraries
|
||||
- Clean, well-structured & tested code-base (well, except `pretty-template.php`, for now...)
|
||||
|
||||
@@ -86,6 +85,9 @@ $app['whoops'] = $app->extend('whoops', function($whoops) {
|
||||
return $whoops;
|
||||
});
|
||||
```
|
||||
### Integrating with Laravel 4/Illuminate
|
||||
|
||||
If you're using Laravel 4, as of [this commit to laravel/framework](https://github.com/laravel/framework/commit/64f3a79aae254b71550a8097880f0b0e09062d24), you're already using Whoops! Yay!
|
||||
|
||||
### Integrating with Laravel 3
|
||||
|
||||
@@ -93,17 +95,6 @@ User [@hdias](https://github.com/hdias) contributed a simple guide/example to he
|
||||
|
||||
https://gist.github.com/hdias/5169713#file-start-php
|
||||
|
||||
|
||||
### Integrating with Laravel 4/Illuminate
|
||||
|
||||
User [@schickling](https://github.com/schickling) contributed a service provider for Laravel 4. Just include this in your app/config/app.php in the "providers" array:
|
||||
|
||||
```php
|
||||
'Whoops\Provider\Illuminate\WhoopsServiceProvider'
|
||||
```
|
||||
|
||||
Alternatively, [@dberry37388](https://github.com/dberry37388)'s [laravel4-support](https://github.com/dberry37388/laravel4-support) package also integrates **whoops** into your fancy-schmancy Laravel stack.
|
||||
|
||||
### Available Handlers
|
||||
|
||||
**whoops** currently ships with the following built-in handlers, available in the `Whoops\Handler` namespace:
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Whoops - php errors for cool kids
|
||||
* @author Filipe Dobreira <https://github.com/filp>
|
||||
*/
|
||||
|
||||
namespace Whoops\Provider\Illuminate;
|
||||
use Whoops\Handler\PrettyPageHandler;
|
||||
use Whoops\Run;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
/**
|
||||
* Provides support for Illuminate (Laravel 4)
|
||||
* @author schickling <https://github.com/schickling>
|
||||
*/
|
||||
class WhoopsServiceProvider extends ServiceProvider {
|
||||
|
||||
/**
|
||||
* Register the service provider for whoops to laravel
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$app = $this->app;
|
||||
|
||||
$app['whoops.error_page_handler'] = $app->share(function($app) {
|
||||
return new PrettyPageHandler;
|
||||
});
|
||||
|
||||
$app['whoops'] = $app->share(function($app) {
|
||||
$run = new Run;
|
||||
|
||||
// Do not register the pretty page handler if we're running
|
||||
// within a console application:
|
||||
if(!$app->runningInConsole() && !$app->runningUnitTests()) {
|
||||
$run->pushHandler($app['whoops.error_page_handler']);
|
||||
}
|
||||
|
||||
return $run;
|
||||
});
|
||||
|
||||
if ($app['config']->get('app.debug')) {
|
||||
$app->error(function($e) use ($app) {
|
||||
$app['whoops']->handleException($e);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user