You are here

function drush_features_list in Features 7

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

Get a list of all feature modules.

2 calls to drush_features_list()
drush_features_diff in ./features.drush.inc
Show the diff of a feature module.
drush_features_revert in ./features.drush.inc
Revert a feature to it's code definition. Optionally accept a list of components to revert.

File

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

Code

function drush_features_list() {
  module_load_include('inc', 'features', 'features.export');
  $rows = array(
    array(
      dt('Name'),
      dt('Feature'),
      dt('Status'),
      dt('Version'),
      dt('State'),
    ),
  );
  foreach (features_get_features(NULL, TRUE) as $k => $m) {
    switch (features_get_storage($m->name)) {
      case FEATURES_DEFAULT:
      case FEATURES_REBUILDABLE:
        $storage = '';
        break;
      case FEATURES_OVERRIDDEN:
        $storage = dt('Overridden');
        break;
      case FEATURES_NEEDS_REVIEW:
        $storage = dt('Needs review');
        break;
    }
    $rows[] = array(
      $m->info['name'],
      $m->name,
      $m->status ? dt('Enabled') : dt('Disabled'),
      $m->info['version'],
      $storage,
    );
  }
  drush_print_table($rows, TRUE);
}