Changeset 7824
- Timestamp:
- 03/12/08 13:28:48 (8 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/lib/task/cache/sfCacheClearTask.class.php
r7815 r7824 80 80 $dirFinder = sfFinder::type('dir')->ignore_version_control()->discard('.sf')->maxdepth(0)->relative(); 81 81 82 // clear global cache83 if (is_null($options['app']))84 {85 $this->getFilesystem()->remove(sfFinder::type('file')->ignore_version_control()->discard('.sf')->in(sfConfig::get('sf_cache_dir')));86 }87 88 82 // iterate through applications 89 83 $apps = is_null($options['app']) ? $dirFinder->in(sfConfig::get('sf_apps_dir')) : array($options['app']); 90 84 foreach ($apps as $app) 91 85 { 86 $class = $app.'Configuration'; 87 require_once sfConfig::get('sf_lib_dir').'/'.$class.'.class.php'; 88 $appConfiguration = new $class('cli', true); 89 92 90 if (!is_dir(sfConfig::get('sf_cache_dir').'/'.$app)) 93 91 { 94 92 continue; 95 93 } 96 97 $class = $app.'Configuration';98 require_once sfConfig::get('sf_lib_dir').'/'.$class.'.class.php';99 $appConfiguration = new $class('dev', true);100 94 101 95 // iterate through environments … … 119 113 if (!method_exists($this, $method)) 120 114 { 121 throw new InvalidArgumentException(sprintf('Do n\'t know how to remove the cache for type "%s".', $options['type']));115 throw new InvalidArgumentException(sprintf('Do not know how to remove cache for type "%s".', $options['type'])); 122 116 } 123 117 $this->$method($appConfiguration, $env); … … 126 120 $this->unlock($app, $env); 127 121 } 122 } 123 124 // clear global cache 125 if (is_null($options['app'])) 126 { 127 $this->getFilesystem()->remove(sfFinder::type('file')->ignore_version_control()->discard('.sf')->in(sfConfig::get('sf_cache_dir'))); 128 128 } 129 129 }