You are here

function features_get_storage in Features 7.2

Same name and namespace in other branches
  1. 6 features.export.inc \features_get_storage()
  2. 7 features.export.inc \features_get_storage()

Gets a summary storage state for a feature.

Parameters

string $module_name: Module name.

Return value

int Value of one of the component state constants listed below. The number is the maximum of all individual component states for the given module, or FEATURES_DEFAULT if no component states found in the module.

See also

FEATURES_REBUILDABLE

FEATURES_DEFAULT

FEATURES_OVERRIDDEN

FEATURES_NEEDS_REVIEW

FEATURES_REBUILDING

5 calls to features_get_storage()
drush_features_diff_all in ./features.drush.inc
Diff all enabled features that are not in their default state.
drush_features_list in ./features.drush.inc
Drush command callback for 'features-list'.
drush_features_revert_all in ./features.drush.inc
Drush command callback for 'features-revert-all'.
features_access_override_actions in ./features.module
Menu access callback for 'admin/structure/features/%feature/diff'.
features_feature_status in ./features.admin.inc
Page callback. Sends a json response with the status of a feature.

File

./features.export.inc, line 867
Contains functions that export configuration into feature modules.

Code

function features_get_storage($module_name) {

  // Get component states, and array_diff against array(FEATURES_DEFAULT).
  // If the returned array has any states that don't match FEATURES_DEFAULT,
  // return the highest state.
  $states = features_get_component_states(array(
    $module_name,
  ), FALSE);
  $states = array_diff($states[$module_name], array(
    FEATURES_DEFAULT,
  ));
  $storage = !empty($states) ? max($states) : FEATURES_DEFAULT;
  return $storage;
}