andrey-mokhov/bjy-profiler

Zend\Db的数据库分析器(也是ZendDeveloperTools的插件)。此模块源自bjyoungblood/bjy-profiler

1.3.0 2017-04-12 19:02 UTC

This package is auto-updated.

Last update: 2024-09-24 18:16:21 UTC


README

主分支: 构建状态 覆盖率状态

为Zend\Db适配器提供数据库查询分析的扩展,以及类似于ZF1的Zend_Db_Profiler的分析器。我将大部分代码从ZF1的Zend_Db迁移而来。

注意:此模块现在与Zend\Db的内置分析器兼容。

注意:要显示查询配置文件中的堆栈跟踪,需要PHP >= 5.5。

Composer/Packagist用户

composer require --dev andrey-mokhov/bjy-profiler

配置与使用

BjyProfiler添加到development.config.php文件中的modules部分,例如

return [
    // Additional modules to include when in development mode
    'modules' => [
        'ZendDeveloperTools',
        'BjyProfiler',
    ],
    // Configuration overrides during development mode
    'module_listener_options' => [
        'config_glob_paths' => [realpath(__DIR__) . '/autoload/{,*.}{global,local}-development.php'],
        'config_cache_enabled' => false,
        'module_map_cache_enabled' => false,
    ],
];
$profiler = $sl->get('Zend\Db\Adapter\Adapter')->getProfiler();
$queryProfiles = $profiler->getQueryProfiles();