Code snippets for symfony 1.x

Navigation

Clear the cache without symfony cli and cross applications

Just use the '**' pattern with sfFileCache :

$frontend_cache_dir = sfConfig::get('sf_cache_dir').'/frontend/prod/template';
$cache = new sfFileCache(array('cache_dir' => $frontend_cache_dir)); // Use the same settings as the ones defined in the frontend factories.yml
$cache->removePattern('**'); // remove everything in the dir
 
by Damien ALEXANDRE on 2009-10-09, tagged cache  clear 

Comments on this snippet

gravatar icon
#1 Christopher Lewis on 2009-10-21 at 07:31

Works like a charm!