snapshotpl/zf-snap-php-debug-bar

此软件包的最新版本(1.0.0)没有提供许可信息。

Zend Framework 2 的 PHP Debug Bar 模块

1.0.0 2017-12-20 22:23 UTC

README

Zend Framework 2 & 3 的 PHP Debug Bar 模块

由 Witold Wasiczko 创建

PHP Debug Bar Messages

特性

  • 所有 PHP Debug Bar 特性 + 关于 Zend Framework 应用程序的额外信息
    • 直接将日志和调试信息记录到 Debug Bar
    • 检查请求变量 ($_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 文件