Skip to content

Commit

Permalink
DatabaseExtension: detects Tracy by presence of service @tracy\BlueSc…
Browse files Browse the repository at this point in the history
…reen [Closes nette/di#245]
  • Loading branch information
dg committed Oct 15, 2020
1 parent fb8e92e commit ec83f63
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Bridges/DatabaseDI/DatabaseExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function getConfigSchema(): Nette\Schema\Schema
'user' => Expect::string()->nullable()->dynamic(),
'password' => Expect::string()->nullable()->dynamic(),
'options' => Expect::array(),
'debugger' => Expect::bool(true),
'debugger' => Expect::bool(),
'explain' => Expect::bool(true),
'reflection' => Expect::string(), // BC
'conventions' => Expect::string('discovered'), // Nette\Database\Conventions\DiscoveredConventions
Expand Down Expand Up @@ -113,7 +113,7 @@ private function setupDatabase(\stdClass $config, string $name): void
->setFactory(Nette\Database\Context::class, [$connection, $structure, $conventions])
->setAutowired($config->autowired);

if ($config->debugger) {
if ($config->debugger ?? $builder->getByType(\Tracy\BlueScreen::class)) {
$connection->addSetup('@Tracy\BlueScreen::addPanel', [
[Nette\Bridges\DatabaseTracy\ConnectionPanel::class, 'renderException'],
]);
Expand Down

0 comments on commit ec83f63

Please sign in to comment.