darkenphp/debugbar
Composer 安装命令:
composer require darkenphp/debugbar
包简介
A Darken boilerplate for creating a new extension.
README 文档
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; }
统计信息
- 总下载量: 24
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2025-01-02