You are here

function features_get_components in Features 6

Same name and namespace in other branches
  1. 7.2 features.module \features_get_components()
  2. 7 features.module \features_get_components()

Returns the array of supported components.

Parameters

$feature_source: If set to to TRUE return feature sources only.

Return value

An array of component labels keyed by the component names.

14 calls to features_get_components()
drush_features_add in ./features.drush.inc
Add a component to a features module.
drush_features_export in ./features.drush.inc
Create a feature module based on a list of components.
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().
features_export_form in ./features.admin.inc
Form callback for features export form. Acts as a router based on the form_state.

... See full list

1 string reference to 'features_get_components'
features_update_6101 in ./features.install
Update 6101: Set codestate signature for all features.

File

./features.module, line 377
Module file for the features module, which enables the capture and management of features in Drupal. A feature is a collection of Drupal entities which taken together statisfy a certain use-case.

Code

function features_get_components($feature_source = FALSE, $reset = FALSE) {
  features_include();
  static $components_all;
  static $components_source;
  if (!isset($components_all) || $reset) {
    $components_all = $components_source = array();
    foreach (module_implements('features_api') as $module) {
      $info = module_invoke($module, 'features_api');
      foreach ($info as $k => $v) {
        $components_all[$k] = $v;
        if (!empty($v['feature_source'])) {
          $components_source[$k] = $v;
        }
      }
    }
  }
  return $feature_source ? $components_source : $components_all;
}