Conditions | 5 |
Paths | 4 |
Total Lines | 21 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
34 | public function clearAll() |
||
35 | { |
||
36 | /** |
||
37 | * @var Settings settings |
||
38 | */ |
||
39 | $settings = FastcgiCacheBust::$plugin->getSettings(); |
||
40 | if (!empty($settings) && !empty($settings->cachePath)) { |
||
41 | $cacheDirs = explode(',', $settings->cachePath); |
||
42 | foreach ($cacheDirs as $cacheDir) { |
||
43 | $cacheDir = trim($cacheDir); |
||
44 | try { |
||
45 | FileHelper::clearDirectory($cacheDir); |
||
46 | } catch (ErrorException $e) { |
||
47 | Craft::error($e->getMessage(), __METHOD__); |
||
48 | } |
||
49 | Craft::info( |
||
50 | Craft::t( |
||
51 | 'fastcgi-cache-bust', |
||
52 | 'FastCGI Cache busted: `'.$cacheDir |
||
53 | ), |
||
54 | __METHOD__ |
||
55 | ); |
||
60 |