public static function FeaturesHelper::revert in Helper 7
Deprecated
Use features_revert_module($module) instead.
2 calls to FeaturesHelper::revert()
File
- lib/
FeaturesHelper.php, line 10
Class
Code
public static function revert(array $modules, $force = FALSE) {
module_load_include('inc', 'features', 'features.export');
features_include(TRUE);
$items = array();
$states = features_get_component_states($modules, TRUE, TRUE);
$restore_states = array(
FEATURES_OVERRIDDEN,
FEATURES_REBUILDABLE,
FEATURES_NEEDS_REVIEW,
);
foreach ($states as $module_name => $components) {
foreach ($components as $component => $state) {
if ($force || in_array($state, $restore_states)) {
if (!isset($items[$module_name])) {
$items[$module_name] = array();
}
$items[$module_name][] = $component;
}
}
}
if (!empty($items)) {
return features_revert($items);
}
}