定制 darkenphp/debugbar 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱: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;
}

统计信息

  • 总下载量: 26
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固