diff --git a/Application/Component/DebugBarComponent.php b/Application/Component/DebugBarComponent.php index ce64934..04b76b1 100644 --- a/Application/Component/DebugBarComponent.php +++ b/Application/Component/DebugBarComponent.php @@ -22,9 +22,14 @@ use D3\DebugBar\Application\Models\Collectors\SmartyCollector; use D3\DebugBar\Application\Models\TimeDataCollectorHandler; use DebugBar\Bridge\DoctrineCollector; use DebugBar\Bridge\MonologCollector; +use DebugBar\DataCollector\MemoryCollector; +use DebugBar\DataCollector\MessagesCollector; +use DebugBar\DataCollector\PhpInfoCollector; +use DebugBar\DataCollector\RequestDataCollector; +use DebugBar\DataCollector\TimeDataCollector; +use DebugBar\DebugBar; use DebugBar\DebugBarException; use DebugBar\JavascriptRenderer; -use DebugBar\StandardDebugBar; use Doctrine\DBAL\Connection; use Doctrine\DBAL\Logging\DebugStack; use Monolog\Logger; @@ -37,7 +42,7 @@ use ReflectionException; class DebugBarComponent extends BaseController { - /** @var StandardDebugBar */ + /** @var DebugBar */ protected $debugBar; /** @var JavascriptRenderer */ protected $debugBarRenderer; @@ -58,7 +63,7 @@ class DebugBarComponent extends BaseController parent::__construct(); if (false === isAdmin()) { - $debugbar = new StandardDebugBar(); + $debugbar = new DebugBar(); $this->addCollectors($debugbar); @@ -144,14 +149,22 @@ class DebugBarComponent extends BaseController } /** - * @param StandardDebugBar $debugbar + * @param DebugBar $debugbar * @return void * @throws DatabaseConnectionException * @throws DebugBarException * @throws ReflectionException */ - public function addCollectors(StandardDebugBar $debugbar): void + public function addCollectors(DebugBar $debugbar): void { + // add all default collectors except the useless ExceptionCollector + $debugbar->addCollector(new PhpInfoCollector()); + $debugbar->addCollector(new MessagesCollector()); + $debugbar->addCollector(new RequestDataCollector()); + $debugbar->addCollector(new TimeDataCollector()); + $debugbar->addCollector(new MemoryCollector()); + + // add custom collectors $debugbar->addCollector($this->getOxidShopCollector()); $debugbar->addCollector($this->getOxidConfigCollector()); $debugbar->addCollector($this->getSmartyCollector()); @@ -175,9 +188,9 @@ class DebugBarComponent extends BaseController } /** - * @return StandardDebugBar + * @return DebugBar */ - public function getDebugBar(): StandardDebugBar + public function getDebugBar(): DebugBar { return $this->debugBar; }