Skip to content

Commit

Permalink
Swap register/boot order
Browse files Browse the repository at this point in the history
  • Loading branch information
barryvdh committed Feb 15, 2015
1 parent fddfb08 commit 77b9cc0
Showing 1 changed file with 38 additions and 38 deletions.
76 changes: 38 additions & 38 deletions src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,44 @@ class ServiceProvider extends \Illuminate\Support\ServiceProvider
*/
protected $defer = false;

/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$configPath = __DIR__ . '/../config/debugbar.php';
$this->mergeConfigFrom($configPath, 'debugbar');

$this->app->alias(
'DebugBar\DataFormatter\DataFormatter',
'DebugBar\DataFormatter\DataFormatterInterface'
);

$this->app['debugbar'] = $this->app->share(
function ($app) {
$debugbar = new LaravelDebugBar($app);

$sessionManager = $app['session'];
$httpDriver = new SymfonyHttpDriver($sessionManager);
$debugbar->setHttpDriver($httpDriver);

return $debugbar;
}
);

$this->app->alias('debugbar', 'Barryvdh\Debugbar\LaravelDebugbar');

$this->app['command.debugbar.clear'] = $this->app->share(
function ($app) {
return new Console\ClearCommand($app['debugbar']);
}
);

$this->commands(array('command.debugbar.clear'));
}

/**
* Bootstrap the application events.
*
Expand Down Expand Up @@ -62,44 +100,6 @@ function ($request, $response) use ($debugbar) {

}

/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$configPath = __DIR__ . '/../config/debugbar.php';
$this->mergeConfigFrom($configPath, 'debugbar');

$this->app->alias(
'DebugBar\DataFormatter\DataFormatter',
'DebugBar\DataFormatter\DataFormatterInterface'
);

$this->app['debugbar'] = $this->app->share(
function ($app) {
$debugbar = new LaravelDebugBar($app);

$sessionManager = $app['session'];
$httpDriver = new SymfonyHttpDriver($sessionManager);
$debugbar->setHttpDriver($httpDriver);

return $debugbar;
}
);

$this->app->alias('debugbar', 'Barryvdh\Debugbar\LaravelDebugbar');

$this->app['command.debugbar.clear'] = $this->app->share(
function ($app) {
return new Console\ClearCommand($app['debugbar']);
}
);

$this->commands(array('command.debugbar.clear'));
}

/**
* Get the services provided by the provider.
*
Expand Down

0 comments on commit 77b9cc0

Please sign in to comment.