How to disable profiler in Symfony2 in production?
I do not mean the toolbar - I mean the profiler.
I want to disable it in production, I use it extensively for development so the solution with removing its bundle is a no-go.
I have tried setting framework.profiler.only_exceptions
to true. I have tried removing the framework.profiler
section altogether. No matter what the profiler.db is growing after every request and every response contains x-debug-token
header.
I have double-checked the config files (config.yml and config_prod.yml) and everything seems to be fined.
What's more the command app/console router:dump-apache --no-debug
always dumps the _wdt
and _profiler
routes, but I don't have them in my routing_prod.yml and they don't seem to be present when trying to access them from the browser (404).
I'm running symfony 2.0 and I won't upgrade right now because of some major changes in 2.1 which would require a rewrite of many elements. It wouldn't be wise to start it just before initial deployment.
if(in_array($this->getEnvironment(), array('dev', 'test')))
. The strange thing is that the profiler is loaded nevertheless. I shall investigate when have the time.