Symfony >= 2.2
As of Symfony 2.2 the profiler supports an enabled
flag in the framework's configuration and is disabled by default in the test
environment.
# app/config/config_test.yml
framework:
profiler:
enabled: false
See this Blog entry about Profiling by Fabien Potencier and the FrameworkBundle configuration reference for more details.
Update: This flag is still valid in Symfony 4.0.
Symfony <= 2.1
In Symfony <= 2.1 The profiler is disabled entirely if there's no framework.profiler
key in the configuration.
You can see this in the ProfilerPass of the Symfony2 FrameworkBundle configuration.
This is the case for the default config.yml
and config_prod.yml
(which includes the former). So if you didn't tinker with the default configurations you're fine.
In config_dev.yml
however the default setting is:
framework:
profiler: { only_exceptions: false }
Which enables profiling for the dev
environment and all enviroments that import config_dev.yml
like config_test.yml
.
If you want to unset the profiler value in a subsequent configuration use:
framework:
profiler: false
Values like {}
or ~
won't unset the value. You have to use false
.