Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I disable the Symfony 2 profiler bar?

It's not adding anything and it makes the page slower and I want it gone. Don't ask. There's little about the profiler on the website and nothing in the app config.

like image 431
Rudie Avatar asked Jan 05 '12 21:01

Rudie


4 Answers

This setting is in app/config/config_dev.yml:

web_profiler:
    toolbar: true
    intercept_redirects: false
like image 99
Rudie Avatar answered Nov 17 '22 04:11

Rudie


Additional: if you want to disable it for a special action in your controller than use this:

if ($this->container->has('profiler'))
{
    $this->container->get('profiler')->disable();
}
like image 90
Besnik Avatar answered Nov 17 '22 02:11

Besnik


If you set framework.profiler.collect to false in your config.yml, the profiler bar won't be shown (even if web_profiler.toolbar is set to true).

 framework:
    profiler:
        collect: false

This then allows you to selectively activate collectors in your code manually, like this:

$this->container->get('profiler')->enable();

Documentation here: http://symfony.com/doc/current/reference/configuration/framework.html#collect

like image 19
Tib Avatar answered Nov 17 '22 04:11

Tib


If you have created a new Symfony project since Symfony 2.5, these parameters are set in app/config/paramaters.yml

parameters:
    # ...
    debug_toolbar: true
    debug_redirects: false

Just set debug_toolbar to false.

like image 6
Adam Elsodaney Avatar answered Nov 17 '22 04:11

Adam Elsodaney