bupy7/zf-php-debug-bar

此包已被废弃,不再维护。未建议替代包。
关于此包的最新版本(1.0.1)没有可用的许可信息。

Zend Framework 2/3 的 PHP Debug Bar 模块

1.0.1 2018-06-16 08:24 UTC

This package is auto-updated.

Last update: 2020-05-22 19:31:12 UTC


README

Latest Stable Version Total Downloads License Coverage Status Build Status

PHP Debug Bar 模块,适用于 Zend Framework 2 & 3

由 Witold Wasiczko 和其他开发者创建。

PHP Debug Bar Messages

此包是 snapshotpl/ZfSnapPhpDebugBar 的分支。

功能

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

安装

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

运行以下命令之一

php composer require --dev snapshotpl/zf-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 文件