You are here

function features_feature_lock in Features 7.2

Locks a feature or its component.

Parameters

string $feature: A (feature) module name.

string|null $component: (optional) A component name, e.g. 'field_instance'.

2 calls to features_feature_lock()
features_admin_lock in ./features.admin.inc
Page callback to lock or unlock a component.
features_feature_lock_confirm_form_submit in ./features.admin.inc
Submit callback to lock components of a feature.

File

./features.module, line 1486
Main *.module file for the 'features' module.

Code

function features_feature_lock($feature, $component = NULL) {
  $locked = variable_get('features_feature_locked', array());
  $locked[$feature] = !empty($locked[$feature]) ? $locked[$feature] : array();
  if ($component) {
    $locked[$feature][$component] = TRUE;
  }
  else {
    $locked[$feature]['_all'] = TRUE;
  }
  variable_set('features_feature_locked', $locked);
}