darkenphp / debugbar
There is no license information available for the latest version (dev-main) of this package.
A Darken boilerplate for creating a new extension.
Package info
github.com/darkenphp-extensions/debugbar
Type:extension
pkg:composer/darkenphp/debugbar
dev-main
2025-08-23 05:46 UTC
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: 2026-02-23 06:58:19 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; }