function drush_image_flush

8.0.x image.drush.inc drush_image_flush($style_name = NULL)
6.x image.drush.inc drush_image_flush($style_name = NULL)
7.x image.drush.inc drush_image_flush($style_name = NULL)
4.x image.drush.inc drush_image_flush($style_name = NULL)
5.x image.drush.inc drush_image_flush($style_name = NULL)
master image.drush.inc drush_image_flush($style_name = NULL)

File

commands/core/image.drush.inc, line 80
Image module's drush integration.

Code

function drush_image_flush($style_name = NULL) {
  drush_include_engine('drupal', 'image');
  if (drush_get_option('all')) {
    $style_name = 'all';
  }

  if (empty($style_name)) {
    $styles = array_keys(drush_image_styles());
    $choices = array_combine($styles, $styles);
    $choices = array_merge(array('all' => 'all'), $choices);
    $style_name = drush_choice($choices, dt("Choose a style to flush."));
    if ($style_name === FALSE) {
      return drush_user_abort();
    }
  }

  if ($style_name == 'all') {
    foreach (drush_image_styles() as $style_name => $style) {
      drush_image_flush_single($style_name);
    }
    drush_log(dt('All image styles flushed'), LogLevel::SUCCESS);
  }
  else {
    drush_image_flush_single($style_name);
  }
}