Skip to content

Commit

Permalink
DebugPlugin: bugfix registering panel if global.debug and plugin.debu…
Browse files Browse the repository at this point in the history
…g are true/false
  • Loading branch information
f3l1x committed Jul 4, 2018
1 parent f6085ac commit 90ac9fa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/DI/DebugPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ public function __construct(PluginCompiler $compiler)
public function loadPluginConfiguration()
{
$builder = $this->getContainerBuilder();
$config = $this->compiler->getExtension()->getConfig();
$global = $this->compiler->getExtension()->getConfig();
$config = $this->getConfig();

if ($config['debug'] !== TRUE) return;
if ($global['debug'] !== TRUE && $config['debug'] !== TRUE) return;

$builder->addDefinition($this->prefix('panel'))
->setClass(ApiPanel::class);
Expand Down Expand Up @@ -94,7 +95,7 @@ public function afterPluginCompile(ClassType $class)
$initialize->addBody('?::register($this->getService(?));', [ContainerBuilder::literal(ApiBlueScreen::class), 'tracy.blueScreen']);
$initialize->addBody('?::register($this->getService(?));', [ContainerBuilder::literal(ValidationBlueScreen::class), 'tracy.blueScreen']);

if ($global['debug'] === TRUE || $config['debug'] === TRUE) {
if ($global['debug'] === TRUE && $config['debug'] === TRUE) {
$initialize->addBody('$this->getService(?)->addPanel($this->getByType(?));', ['tracy.bar', ApiPanel::class]);
}
}
Expand Down

0 comments on commit 90ac9fa

Please sign in to comment.