Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

symfony2 webprofiler show prod environment

Tags:

symfony

The system in the dev environment going very slow with jquery but in prod me very well, could put the webprofiler in the prod environment? greetings and thanks

like image 956
Bicu Avatar asked Oct 27 '12 14:10

Bicu


1 Answers

Add this to routing.yml:

_wdt:
    resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
    prefix:   /_wdt

_profiler:
    resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
    prefix:   /_profiler

Add this to config_prod.yml:

web_profiler:
    toolbar: true

Change this in AppKernel.php:

Remove $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle() from this statement:

if (in_array($this->getEnvironment(), array('dev', 'test'))) {
    // ...
}

and add this to the bundles array outside of the if statement:

new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle()

In app.php set debug=true

$kernel = new AppKernel('prod', true);

In config_prod.yml add:

framework:
    profiler:
        only_exceptions: false

That should do the trick.

Don't forgot to execute this after making the code changes:

$ php ./app/console cache:clear --env=prod --no-debug
like image 144
Nick Stemerdink Avatar answered Sep 30 '22 02:09

Nick Stemerdink