You are here

function asset_injector_cache_flush in Asset Injector 8.2

Same name and namespace in other branches
  1. 8 asset_injector.module \asset_injector_cache_flush()

Implements hook_cache_flush().

Delete all asset files.

File

./asset_injector.module, line 202
Contains module asset_injector.

Code

function asset_injector_cache_flush() {
  try {
    AssetFileStorage::deleteAllFiles();
  } catch (\Exception $e) {
    \Drupal::messenger()
      ->addWarning(t('Unable to regenerate the Asset Injector assets. This is due to a file permission issue, please contact the site administrator.'));
  }
}