You are here

function drush_d8cache_invalidate_cache_tags in Drupal 8 Cache Backport 7

Drush command logic.

Implements drush_[COMMAND_NAME]().

File

./d8cache.drush.inc, line 33
Drush hooks for d8cache.

Code

function drush_d8cache_invalidate_cache_tags($tags = '') {
  $tags = array_map('trim', explode(',', $tags));
  $tags = array_filter($tags);
  if (!empty($tags)) {
    drupal_invalidate_cache_tags($tags);
    drush_log(dt('Succesfully invalidated the following cache tags: !tags', array(
      '!tags' => implode(',', $tags),
    )), 'success');
  }
  else {
    $error = dt('The list of cache tags to invalidate must not be empty.');
    drush_log($error, 'error');
  }
}