Skip to content

Commit 1309dd7

Browse files
committed
Do no remove .* files when clearing the cache
Thanks @nexik for the idea
1 parent 088b946 commit 1309dd7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/task/cache/sfCacheClearTask.class.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ protected function execute($arguments = array(), $options = array())
7878
}
7979

8080
// finder to find directories (1 level) in a directory
81-
$dirFinder = sfFinder::type('dir')->discard('.sf')->maxdepth(0)->relative();
81+
$dirFinder = sfFinder::type('dir')->discard('.*')->maxdepth(0)->relative();
8282

8383
// iterate through applications
8484
$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())
125125
// clear global cache
126126
if (null === $options['app'] && 'all' == $options['type'])
127127
{
128-
$this->getFilesystem()->remove(sfFinder::type('file')->discard('.sf')->in(sfConfig::get('sf_cache_dir')));
128+
$this->getFilesystem()->remove(sfFinder::type('file')->discard('.*')->in(sfConfig::get('sf_cache_dir')));
129129
}
130130
}
131131

@@ -150,7 +150,7 @@ protected function clearConfigCache(sfApplicationConfiguration $appConfiguration
150150
if (is_dir($subDir))
151151
{
152152
// remove cache files
153-
$this->getFilesystem()->remove(sfFinder::type('file')->discard('.sf')->in($subDir));
153+
$this->getFilesystem()->remove(sfFinder::type('file')->discard('.*')->in($subDir));
154154
}
155155
}
156156

@@ -191,7 +191,7 @@ protected function clearModuleCache(sfApplicationConfiguration $appConfiguration
191191
if (is_dir($subDir))
192192
{
193193
// remove cache files
194-
$this->getFilesystem()->remove(sfFinder::type('file')->discard('.sf')->in($subDir));
194+
$this->getFilesystem()->remove(sfFinder::type('file')->discard('.*')->in($subDir));
195195
}
196196
}
197197

0 commit comments

Comments
 (0)