public function JsCollectionOptimizer::deleteAll in Flysystem 8
Same name and namespace in other branches
- 3.x src/Asset/JsCollectionOptimizer.php \Drupal\flysystem\Asset\JsCollectionOptimizer::deleteAll()
- 2.0.x src/Asset/JsCollectionOptimizer.php \Drupal\flysystem\Asset\JsCollectionOptimizer::deleteAll()
- 3.0.x src/Asset/JsCollectionOptimizer.php \Drupal\flysystem\Asset\JsCollectionOptimizer::deleteAll()
Deletes all optimized asset collections assets.
Overrides JsCollectionOptimizer::deleteAll
File
- src/
Asset/ JsCollectionOptimizer.php, line 21
Class
- JsCollectionOptimizer
- Optimizes JavaScript assets.
Namespace
Drupal\flysystem\AssetCode
public function deleteAll() {
$this->state
->delete('system.js_cache_files');
$delete_stale = function ($uri) {
// Default stale file threshold is 30 days.
if (REQUEST_TIME - filemtime($uri) > \Drupal::config('system.performance')
->get('stale_file_threshold')) {
file_unmanaged_delete($uri);
}
};
file_scan_directory($this
->getSchemeForExtension('js') . '://js', '/.*/', [
'callback' => $delete_stale,
]);
}