You are here

function features_include in Features 6

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

Load includes for any modules that implement the features API and load includes for those provided by features.

19 calls to features_include()
drush_features_revert in ./features.drush.inc
Revert a feature to it's code definition.
FeaturesUserTestCase::_test_filter in tests/features.test
FeaturesUserTestCase::_test_user_permission in tests/features.test
features_access_override_actions in ./features.module
Menu access callback for whether a user should be able to access override actions for a given feature.
features_admin_components_revert in ./features.admin.inc
Submit handler for revert form.

... See full list

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

File

./features.module, line 263
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_include($reset = FALSE) {
  static $once;
  if (!isset($once) || $reset) {
    $once = TRUE;

    // Check for implementing modules and make necessary inclusions.
    foreach (module_implements('features_api') as $module) {
      $info = module_invoke($module, 'features_api');
      foreach ($info as $component) {
        if (isset($component['file'])) {
          require_once $component['file'];
        }
      }
    }

    // Features provides integration on behalf of these modules.
    // The features include provides handling for the feature dependencies.
    // Note that ctools is placed last because it implements hooks "dynamically" for other modules.
    $modules = array(
      'features',
      'block',
      'content',
      'context',
      'fieldgroup',
      'filter',
      'imagecache',
      'menu',
      'node',
      'taxonomy',
      'user',
      'profile',
      'views',
      'ctools',
    );
    foreach (array_filter($modules, 'module_exists') as $module) {
      if (!module_hook($module, 'features_api')) {
        module_load_include('inc', 'features', "includes/features.{$module}");
      }
    }

    // Clear static cache, since we've now included new implementers.
    module_implements('features_api', FALSE, TRUE);
  }
}