From 1309dd7d97bd46cfeaad29f290f5b98fa8337b5f Mon Sep 17 00:00:00 2001 From: j0k3r Date: Mon, 19 Aug 2013 13:58:57 +0200 Subject: [PATCH] Do no remove .* files when clearing the cache Thanks @nexik for the idea --- lib/task/cache/sfCacheClearTask.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/task/cache/sfCacheClearTask.class.php b/lib/task/cache/sfCacheClearTask.class.php index 68c2c5044..1f2d28cb5 100644 --- a/lib/task/cache/sfCacheClearTask.class.php +++ b/lib/task/cache/sfCacheClearTask.class.php @@ -78,7 +78,7 @@ protected function execute($arguments = array(), $options = array()) } // finder to find directories (1 level) in a directory - $dirFinder = sfFinder::type('dir')->discard('.sf')->maxdepth(0)->relative(); + $dirFinder = sfFinder::type('dir')->discard('.*')->maxdepth(0)->relative(); // iterate through applications $apps = null === $options['app'] ? $dirFinder->in(sfConfig::get('sf_apps_dir')) : array($options['app']); @@ -125,7 +125,7 @@ protected function execute($arguments = array(), $options = array()) // clear global cache if (null === $options['app'] && 'all' == $options['type']) { - $this->getFilesystem()->remove(sfFinder::type('file')->discard('.sf')->in(sfConfig::get('sf_cache_dir'))); + $this->getFilesystem()->remove(sfFinder::type('file')->discard('.*')->in(sfConfig::get('sf_cache_dir'))); } } @@ -150,7 +150,7 @@ protected function clearConfigCache(sfApplicationConfiguration $appConfiguration if (is_dir($subDir)) { // remove cache files - $this->getFilesystem()->remove(sfFinder::type('file')->discard('.sf')->in($subDir)); + $this->getFilesystem()->remove(sfFinder::type('file')->discard('.*')->in($subDir)); } } @@ -191,7 +191,7 @@ protected function clearModuleCache(sfApplicationConfiguration $appConfiguration if (is_dir($subDir)) { // remove cache files - $this->getFilesystem()->remove(sfFinder::type('file')->discard('.sf')->in($subDir)); + $this->getFilesystem()->remove(sfFinder::type('file')->discard('.*')->in($subDir)); } }