Symfony2 keeps cache in app\cache folder
Is there a way to change it to different path?
Thanks for any help!
Answer:
Thanks to Aurelijus Valeiša for this!
I did add method (to AppKernel.php) like this:
public function getCacheDir()
{
// Remove whole method if you want to go back to the original cache folder
return 'c:/Users/Mike/Documents/www/cache/'.$this->environment;
}
If you want to do the same with logs folder add this method:
public function getLogDir()
{
// Remove whole method if you want to go back to the original log folder
return 'c:/Users/Mike/Documents/www/logs';
}
Make a note that both methods just overwrite original which are created in Symfony\Component\HttpKernel\Kernel class
Yes, in app/AppKernel.php
file override getCacheDir()
method (defined in Symfony\Component\HttpKernel\Kernel
). As the example, in your extended AppKernel
class you could have:
public function getCacheDir()
{
return $this->rootDir.'/superduper_cache/'.$this->environment;
}