You are here

function features_populate in Features 6

Same name and namespace in other branches
  1. 7.2 features.export.inc \features_populate()
  2. 7 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
AHAH handler for features_export_form_build().
features_export_build_form_submit in ./features.admin.inc
Submit handler for features_export_form_build().
_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);

  // 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;
}