public function BackgroundImageManager::cacheFlush in Background Image 2.0.x
Same name and namespace in other branches
- 8 src/BackgroundImageManager.php \Drupal\background_image\BackgroundImageManager::cacheFlush()
- 2.x src/BackgroundImageManager.php \Drupal\background_image\BackgroundImageManager::cacheFlush()
Flushes the cache.
Overrides BackgroundImageManagerInterface::cacheFlush
File
- src/
BackgroundImageManager.php, line 214
Class
Namespace
Drupal\background_imageCode
public function cacheFlush() {
$this->fileSystem
->scanDirectory('public://background_image/css', '/.*/', [
'callback' => function ($uri) {
try {
// Silence any PHP errors, meant to be passive.
@$this->fileSystem
->deleteRecursive($uri);
} catch (FileException $e) {
// Intentionally do nothing.
}
},
]);
}