Deleting Symfonys cache from a batch

As I tried to delete symfony’s cache while running a symfony batch file, I coulnd manage this by using the sfViewCacheManager. Neither by

[PHP]
$cacheManager = new sfViewCacheManager();
$cacheManager->initialize(sfContext::getInstance(),new sfFileCache(sfConfig::get(‘sf_template_cache_dir’)),array());
$cacheManager->remove(‘browse/index’);
[/PHP]

nor by

[PHP]
$cacheManager = sfContext::getInstance()->getViewCacheManager();
$cacheManager->remove(‘browse/index’);
[/PHP]

In the Symfony book there is another way of deleting cached templates, so I now use sfToolkit::clearGlob to delete. It works, but if anyone knows how to use the sfViewCacheManager in batchmode, I’d like to hear.

[PHP]
sfToolkit::clearGlob(sfConfig::get(‘sf_template_cache_dir’).’/*/*/feeds*/browse.cache’);
[/PHP]

Kommentarfunktion deaktiviert