rafalli/bjy-profiler

Laminas\Db 数据库分析器。从 andrey-mokhov/bjy-profiler 分支出来的模块

1.3.1 2020-02-26 19:12 UTC

This package is auto-updated.

Last update: 2024-09-27 06:02:45 UTC


README

为 Laminas\Db 提供数据库查询分析扩展的适配器,以及类似于 ZF1 的 Zend_Db_Profiler 的分析器。我从 ZF1 的 Zend_Db 中移植了大部分代码。

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

注意:为了使用查询分析中的堆栈跟踪,PHP 需要 >= 5.5。

Composer/Packagist 用户

composer require --dev rafalli/bjy-profiler

配置与使用

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

return [
    // Additional modules to include when in development mode
    'modules' => [
        'Laminas\\DeveloperTools',
        '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('Laminas\Db\Adapter\Adapter')->getProfiler();
$queryProfiles = $profiler->getQueryProfiles();