You are here

function drush_features_update_all in Features 6

Same name and namespace in other branches
  1. 7.2 features.drush.inc \drush_features_update_all()
  2. 7 features.drush.inc \drush_features_update_all()

Update all enabled features. Optionally pass in a list of features to exclude from being updated.

File

./features.drush.inc, line 388
Features module drush integration.

Code

function drush_features_update_all() {
  $features_to_update = array();
  $features_to_exclude = func_get_args();
  foreach (features_get_features() as $module) {
    if ($module->status && !in_array($module->name, $features_to_exclude)) {
      $features_to_update[] = $module->name;
    }
  }
  drush_print(dt('The following modules will be updated: !modules', array(
    '!modules' => implode(', ', $features_to_update),
  )));
  if (drush_confirm(dt('Do you really want to continue?'))) {
    foreach ($features_to_update as $module_name) {
      drush_invoke_process(drush_sitealias_get_record('@self'), 'features-update', array(
        $module_name,
      ));
    }
  }
  else {
    drush_die('Aborting.');
  }
}