Deletes all optimized collection assets.

Note: Core's deleteAll() only deletes old files not all.

File

src/Asset/CssCollectionOptimizer.php, line 241

Class

CssCollectionOptimizer

Namespace

Drupal\advagg\Asset

Code

public function deleteAllReal() {
    $log = [];
    $this->state
        ->delete('system.css_cache_files');
    Cache::invalidateTags([
        'library_info',
    ]);
    $delete_all = function ($uri) use (&$log) {
        file_unmanaged_delete($uri);
        $log[] = $uri;
    };
    $this->state
        ->delete('system.js_cache_files');
    file_scan_directory($this->dumper
        ->preparePath('css'), '/.*/', [
        'callback' => $delete_all,
    ]);
    return $log;
}