darkenphp/debugbar 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

darkenphp/debugbar

Composer 安装命令:

composer require darkenphp/debugbar

包简介

A Darken boilerplate for creating a new extension.

README 文档

README

  1. Composer

Install the debugbar extension. add it to require dev section: composer require darkenphp/debugbar:dev-main --dev

  1. 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.

  1. 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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2025-01-02