/** * @BeforeFeature @enableDKAN_Workflow */ public static function enableDKAN_Workflow(BeforeFeatureScope $scope) { if (!parent::shouldEnableModule("dkan_workflow")) { return; } // This order matters through drupal_flush_all_caches. module_enable(array('link_badges', 'menu_badges', 'views_dkan_workflow_tree', 'workbench', 'workbench_moderation', 'workbench_email')); // Enable 'open_data_federal_extras' module. module_enable(array('dkan_workflow_permissions')); module_enable(array('dkan_workflow')); features_revert(array('dkan_workflow_permissions' => array('roles_permissions'))); drupal_flush_all_caches(); }
/** * @deprecated * * Use features_revert_module($module) instead. */ 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); } }
/** * Revert components from a specific feature. * * @param string $feature_name * Feature machine name. * @param mixed $components * List of components to revert. */ public function revertComponents($feature_name, $components) { $components = !is_array($components) ? array($components) : $components; features_revert(array($feature_name => $components)); }