You are here

function features_populate in Features 7

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

Parameters

$items:

$module_name:

4 calls to features_populate()
features_detect_overrides in ./features.export.inc
Detect differences between DB and code components of a feature.
features_export_build_form_populate in ./features.admin.inc
AJAX callback for features_export_form_build().
features_export_build_form_submit in ./features.admin.inc
Form submission handler for features_export_form().
_drush_features_export in ./features.drush.inc
Write a module to the site dir.

File

./features.export.inc, line 8

Code

function features_populate($items, $dependencies, $module_name) {

  // Sanitize items.
  $items = array_filter($items);
  $items['dependencies'] = drupal_map_assoc(array_filter($dependencies));

  // Populate stub
  $stub = array(
    'features' => array(),
    'dependencies' => array(),
    'conflicts' => array(),
  );
  $export = _features_populate($items, $stub, $module_name);

  // Add Features API version. Any module with this entry in the .info file
  // will be treated as a Feature and included in the admin/build/features UI.
  $export['features']['features_api']['api:' . FEATURES_API] = TRUE;

  // Allow other modules to alter the export.
  drupal_alter('features_export', $export, $module_name);

  // Clean up and standardize order
  foreach (array_keys($export['features']) as $k) {
    ksort($export['features'][$k]);
  }
  ksort($export['features']);
  ksort($export['dependencies']);
  return $export;
}