effiana / web-profiler-extra-bundle

在性能分析器中添加路由、容器、Assetic和Twig信息

安装: 27

依赖: 0

建议: 0

安全: 0

星星: 0

关注者: 1

分支: 48

语言:HTML

类型:symfony-bundle

v2.3.7 2020-01-13 09:24 UTC

This package is auto-updated.

Last update: 2024-09-21 20:39:01 UTC


README

Total Downloads

这个Symfony2扩展包是做什么用的?

它会在你的WebProfiler中添加额外的部分

  • 路由:列出与你的应用程序连接的所有路由
  • 容器:列出容器中所有可用的服务
  • Twig:列出为你应用程序提供的Twig扩展、测试、过滤器以及函数
  • Assetic

WebProfilerExtraBundle

安装

如果你使用的是Symfony >= 2.2

在你的composer.json文件中添加以下内容

"require-dev": {
    [...]
    "elao/web-profiler-extra-bundle" : "~2.3@dev"
},

然后运行php composer.phar update elao/web-profiler-extra-bundle

如果你使用的是Symfony <= 2.1,建议使用此扩展包的2.1分支 "elao/web-profiler-extra-bundle" : "dev-2.1"

在你的AppKernel(app/AppKernel.php)中注册扩展包

大多数情况下,我们只需要在dev环境中激活此扩展包

[...]
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
    [...]
    $bundles[] = new Elao\WebProfilerExtraBundle\WebProfilerExtraBundle();
}

app/config/config_dev.yml中激活不同的收集器

web_profiler_extra:
    routing:
        enabled:        true
        display_in_wdt: true
    container:
        enabled:        true
        display_in_wdt: true
    assetic:
        enabled:        true
        display_in_wdt: true
    twig:
        enabled:        true
        display_in_wdt: true

如果你不使用Assetic,则需要禁用Assetic收集器

web_profiler_extra:
    assetic:
        enabled:        false
        display_in_wdt: false

安装资产

通过运行以下命令安装资产,以便在你的调试栏中看到漂亮的图标

$ app/console assets:install web/ --symlink

屏幕截图

Screenshot