darkenphp / debugbar
A Darken boilerplate for creating a new extension.
Installs: 18
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:extension
Requires
- darkenphp/framework: dev-main
- maximebf/debugbar: ^1.23
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.66
- phpstan/phpstan: ^2.1
This package is auto-updated.
Last update: 2025-08-23 05:46:51 UTC
README
- Composer
Install the debugbar extension. add it to require dev section:
composer require darkenphp/debugbar:dev-main --dev
- Configure Extension
Now add the extension in your app/Config.php
to the extensions()
method:
public function extensions(ExtensionService $service): ExtensionService { return $service ->register(new \Darken\Debugbar\Build\Extension(new \Darken\Debugbar\DebugBarConfig( isActive: $this->getDebugMode() ))); }
The isActive
property of the DebugBarConfig controls, whether the Debugbar is visible or not, we directly connect this to the currents configuraiton getDebugMode()
method.
- Using
You can now Inject the DebugBarConfig anywhere and start using message and start/top methods, an example:
#[\Darken\Attributes\Inject] public \Darken\Debugbar\DebugBarConfig $debug; public function getBlogs() { $this->debug->message('Fetching blog list'); $this->debug->start('fetch_blog_list', 'Retrieving blog list'); $items = $this->blogs->getItems(); $this->debug->stop('fetch_blog_list'); return $items; }