在开发环境中,使用jQuery系统非常缓慢,但是在生产环境中运行得很好。能否将WebProfiler应用于生产环境?谢谢。
在开发环境中,使用jQuery系统非常缓慢,但是在生产环境中运行得很好。能否将WebProfiler应用于生产环境?谢谢。
将以下内容添加到routing.yml
中:
_wdt:
resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
prefix: /_wdt
_profiler:
resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
prefix: /_profiler
将此添加到config_prod.yml
中:web_profiler:
toolbar: true
在 AppKernel.php
文件中进行修改:
从此语句中删除 $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle()
:
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
// ...
}
将此添加到if语句外的bundles数组中:
new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle()
在 app.php
中将 debug 设为 true。$kernel = new AppKernel('prod', true);
在 config_prod.yml
中添加:
framework:
profiler:
only_exceptions: false
应该可以解决问题。
在进行代码更改后,不要忘记执行此操作:
$ php ./app/console cache:clear --env=prod --no-debug