treast / kirby-debugbar
KirbyCMS 的 PHP 调试栏
1.3.3
2024-05-27 17:42 UTC
Requires
- getkirby/composer-installer: ^1.2
- maximebf/debugbar: ^1.18.2
README
✨ 功能
- 集成 PHP Debug Bar
- 轻松记录消息
- 预览配置、调用的钩子、文件、页面变量、请求和异常
- 更多即将推出 👀 ...
🔌 安装
⚠️ 此插件使用 Symfony VarDumper 包,与 KirbyCMS 的 dump 函数冲突。要使用此插件,您必须强制更改根目录下的 index.php
文件内容
<?php define('KIRBY_HELPER_DUMP', false); require __DIR__ . '/kirby/bootstrap.php'; echo (new Kirby)->render();
Composer(强烈推荐)
composer require treast/kirby-debugbar
Git 子模块
git submodule add https://github.com/Treast/kirby-debugbar.git site/plugins/debugbar
手动
下载此 zip 并将其解压到 site/plugins/debugbar
中。
💻 使用方法
将此代码片段添加到您的页脚底部并享受!
<?= snippet('debugbar') ?>
如何记录?
$site->logger()->debug('This is a debug'); $site->logger()->emergency('This is an emergency'); $site->logger()->error('This is an error'); $site->logger()->critical('This is a critical'); $site->logger()->info('This is an info'); $site->logger()->warning('This is a warning'); $site->logger()->alert('This is an alert'); $site->logger()->notice('This is a notice'); $site->logger()->log('debug', 'This is also a debug'); // Or you can chain with the ->log() function $site->log()->title()->log(); $page->children()->log()->first()->log();
选项
说明
config.php
<?php return [ 'treast.debugbar' => [ 'force' => false, 'tabs' => [ 'logs' => true, 'config' => true, 'events' => true, 'files' => true, 'variables' => true, 'request' => true, 'exceptions' => true ] ] ];
待办事项
仅在debug === true
时激活插件- 重构 😮💨
💡 我想使用 XXX 但它还没有提供?
转到问题 并提交您的想法。如果它相关,我可能会添加它 🫶。
❤️ 特别感谢
- 感谢 @maximebf 提供基本包 php-debugbar。
- 感谢 @barryvdh 在 Laravel 上的实现 laravel-debugbar。
- 感谢 @genxbe 在他的插件上的链式方法 kirby3-ray。
⚠️ 警告
请注意,此插件按原样提供,不提供任何明示或暗示的操作保证。使用此插件,您同意自行承担风险。我对因使用此插件造成的任何直接或间接损害(包括数据丢失、操作错误、服务中断或与此插件使用相关的任何其他后果)概不负责。