I have read a lot about the clear cache command for symfony2, but I have this question :
Is php app/console cache:clear --env=prod
with --env
, changes the environment or just clean the cache for that environment?
If only clear the cache for that environment, then what is this line mean in app.php :
$kernel = new AppKernel('prod', false);
I think when I want to use Symfony2 Production Environment I have to change that line to
$kernel = new AppKernel('prod', true);
Am I in the right spot?
The two constructor arguments for Symfony\Component\HttpKernel\Kernel are $environment
and $debug
.
So, to answer your question directly, app.php already uses the production environment. You'll notice that app_dev.php instantiates the kernel like this
$kernel = new AppKernel('dev', true);
So, the environment name that you pass to the kernel constructor maps to the environment name you'd use in console commands (i.e., the --env
).
Does that clear it up for you?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With