biskyt/yii-debug-toolbar
Composer 安装命令:
composer require biskyt/yii-debug-toolbar
包简介
Debug panel for Yii 1.1 (Ported from Yii 2), updated for PHP 8.1+
关键字:
README 文档
README
Debug panel for Yii 1.1 (Ported from Yii 2). Updated to fix compatability with PHP8.1+ Forked from https://github.com/koftikes/yii-debug-toolbar
Installation
This extension is available at packagist.org and can be installed via composer by following command:
composer require --dev biskyt/yii-debug-toolbar.
To enable toolbar in your application add following lines to config:
return [ 'preload' => ['debug'], 'components' => [ 'debug' => [ 'class' => 'Yii2Debug', ], 'db' => [ 'enableProfiling' => true, 'enableParamLogging' => true, ], ], ];
Configuration
You can customize debug panel behavior with this options:
enabled- enable/disable debug panel.allowedIPs- list of IPs that are allowed to access debug toolbar. Default['127.0.0.1', '::1'].accessExpression- additional php expression for access evaluation.logPath- directory storing the debugger data files. This can be specified using a path alias. Default/runtime/debug.historySize- maximum number of debug data files to keep. If there are more files generated, the oldest ones will be removed.highlightCode- highlight code. Highlight SQL queries and PHP variables. This parameter can be set for each panel individually.moduleId- module ID for viewing stored debug logs. Defaultdebug.showConfig- show brief application configuration page. Defaultfalse.hiddenConfigOptions- list of un secure component options to hide (like login, passwords, secret keys). Default is to hideusernameandpasswordofdbcomponent.internalUrls- use nice routes rules in debug module.panels- list of debug panels.
Each attached panel can be configured individually, for example:
'debug' => [ 'class' => 'Yii2Debug', 'panels' => [ 'db' => [ // Disable code highlighting. 'highlightCode' => false, // Disable substitution of placeholders with values in SQL queries. 'insertParamValues' => false, ], ], ]
Each panel have callback option filterData.
You can define custom function for filtering input data before writing it in to debug log.
It's useful when you need to hide something secret or just delete data from logs.
Be careful with data structure manipulation. It can lead to log parsing errors.
Example:
'debug' => [ 'class' => 'Yii2Debug', 'panels' => [ 'db' => [ 'filterData' => function($data) { // Your code here return $data; } ], ], ]
Creating own panels
To create own debug panel you can extend class Yii2DebugPanel, for example:
class MyTestPanel extends Yii2DebugPanel { /** * The name of panel printed in debugger */ public function getName() { return 'Name'; } /** * Return summary html with results of execution in current request. * Data is available through $this->data */ public function getSummary() { return ''; } /** * Return detailed html report with results of execution in current request. * Data is available through $this->data */ public function getDetail() { return ''; } /** * Return data required for storing in logs. */ public function save() { return array(); } }
And attach this panel in config:
'panels' => [ 'test' => [ 'class' => 'path.to.panel.MyTestPanel', // ... ], ],
Disable individual panels
To disable an individual panel, either a core or custom panel, set the enabled property in the panel config to false.
Example: Disable core profiling panel
'panels' => [ 'profiling' => [ 'enabled' => false, // ... ], ],
Variables dumping
With static method Yii2Debug::dump() you can dump any data and examine it later in debug log.
biskyt/yii-debug-toolbar 适用场景与选型建议
biskyt/yii-debug-toolbar 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 116.82k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 05 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「debug」 「extension」 「yii」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 biskyt/yii-debug-toolbar 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 biskyt/yii-debug-toolbar 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 biskyt/yii-debug-toolbar 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Debug your SimpleBus EventBus and CommandBus
nice output for debug functions for PHP 5.3
A custom URL rule class for Yii 2 which allows to create translated URL rules
Yii2 LightBox image galary widget uses Lightbox v2.10.0 by Lokesh Dhakar
The Yii2 extension uses jQuery jquery.carousel-1.1.min.js and makes image carousel from php array of structure defined.
TYPO3 CMS extension to create gallery content element with preset crop ratios and pagination
统计信息
- 总下载量: 116.82k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 16
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2024-05-13