Last Updated: February 25, 2016
·
2.229K
· mimopoweb

Symfony 1.4 - Disable Doctrine profiler on cli environment

Just leave databases.yml without specify the profiler option and add the following code to the ProjectConfiguration class.

if (0 == strncasecmp(PHP_SAPI, 'cli', 3) || sfConfig::get('sf_environment') == 'cli'){
    sfConfig::set('sf_debug', false);
}

Now you will be able to run command line tasks with database intensive actions without worrying about PHP out of memory errors.

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

PHP applications still send a browser full of JavaScript. Hardening the server does not inventory the payment, analytics, and plugin scripts that run after the HTML is delivered.

Security insights from Cside