graef685/zf-snap-php-debug-bar

此包的最新版本(2.0.2)没有提供许可证信息。

Zend Framework 2的PHP调试栏模块

2.0.2 2021-08-06 13:48 UTC

README

Zend Framework 2 & 3的PHP调试栏模块

由Witold Wasiczko创建

PHP Debug Bar Messages

功能

  • 所有PHP调试栏功能 + 关于Zend Framework应用程序的附加信息
    • 直接将日志和调试信息输出到调试栏
    • 检查请求变量($_POST, $_GET, $_SERVER, $_COOKIE)
    • 使用时间线查看常见事件之间的时间
    • 捕获异常
    • 预览配置和应用程序配置
    • 分析SQL查询
    • 当前路由的详细信息
    • 内存使用情况
    • 总请求持续时间
    • 自定义调试栏视图
    • 以及更多...
  • 可直接使用 - 只需通过composer安装!
  • 通过模块配置轻松配置

安装

安装此扩展的首选方式是通过composer

运行以下命令

php composer require --dev snapshotpl/zf-snap-php-debug-bar

用法

将模块ZfSnapPhpDebugBar添加到application.config.php

return [
    'modules' => [
        'ZfSnapPhpDebugBar',
    ],
];

如何使用消息选项卡

通过函数

debugbar_log('ZfSnapPhpDebugBar is awesome!');

通过静态方法

ZfSnapPhpDebugBar\Module::log('ZfSnapPhpDebugBar is awesome!');

通过Zend\Log

$writer = $sm->get(ZfSnapPhpDebugBar\Log\Writer\PhpDebugBar::class);
$log = new Zend\Log\Logger();
$log->addWriter($writer);
$log->info('ZfSnapPhpDebugBar is awesome!');

直接通过ServiceManager中的DebugBar对象

$debugbar = $sm->get('debugbar');
$debugbar['messages']->addMessage('ZfSnapPhpDebugBar is awesome!'));

如何配置

查看config/zfsnapphpdebugbar.config.php文件