【问题标题】:Symfony2: How to disable profiler entirely?Symfony2:如何完全禁用分析器?
【发布时间】:2012-06-01 14:29:58
【问题描述】:

即使我从所有 config*.yml 文件中删除 web_profiler... 我得到了

RuntimeException: You need to enable either the SQLite3 or PDO_SQLite extension for the profiler to run properly.

我只是不想在我的系统上安装 sqlite,我找不到如何完全关闭分析器...

有什么建议吗?

UPD:在 FrameworkExtension.php 中注释

if (isset($config['profiler'])) {
    $this->registerProfilerConfiguration($config['profiler'], $container, $loader);
}

但这不是好的解决方案

【问题讨论】:

  • 你也可以安装 php sqlite 扩展..

标签: php symfony profiler


【解决方案1】:

或者你可以在你的 config_dev.yml 中改变:

web_profiler:
    toolbar: false

【讨论】:

    【解决方案2】:

    看看你的 app/AppKernel.php。

    删除线

    $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
    

    应该做的伎俩!现在捆绑包永远不会被加载,因此现在需要 SQLite2 数据库。

    【讨论】:

    • 别忘了去掉app_dev.yml中的profiler配置,否则会报错页面
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-07-12
    相关资源
    最近更新 更多