Skip to content

Commit

Permalink
Merge branch 'master' into wip/merge-upstream
Browse files Browse the repository at this point in the history
* master:
  Minor syntax
  Disable Twig for now
  Prevent double load
  Fixes model pollution when bar is disabled

# Conflicts:
#	Plugin.php
#	classes/ServiceProvider.php
#	updates/version.yaml
  • Loading branch information
LukeTowers committed Aug 2, 2022
2 parents 486a236 + 1279f7a commit 06039bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 7 additions & 2 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class Plugin extends PluginBase

/**
* Returns information about this plugin.
*
* @return array
*/
public function pluginDetails()
Expand All @@ -46,7 +45,7 @@ public function pluginDetails()
'author' => 'Winter CMS',
'icon' => 'icon-bug',
'homepage' => 'https://github.com/wintercms/wn-debugbar-plugin',
'replaces' => ['RainLab.Debugbar' => '<= 3.2.0'],
'replaces' => ['RainLab.Debugbar' => '<= 3.3.2'],
];
}

Expand Down Expand Up @@ -89,11 +88,17 @@ public function register()
*/
public function boot()
{
// Disabled by config, halt
if (Config::get('debugbar.enabled') === false) {
return;
}

// Register middleware
if (Config::get('app.debugAjax', false)) {
$this->app[HttpKernelContract::class]->pushMiddleware(\Winter\Debugbar\Middleware\InterpretsAjaxExceptions::class);
}

// Register custom collectors
if ($this->app->runningInBackend()) {
$this->addBackendCollectors();
} else {
Expand Down
1 change: 0 additions & 1 deletion classes/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class ServiceProvider extends BaseServiceProvider
protected function registerMiddleware($middleware)
{
$kernel = $this->app[Kernel::class];

$kernel->pushMiddleware(InjectDebugbar::class);
}
}

0 comments on commit 06039bb

Please sign in to comment.