You are here

function features_get_conflicts in Features 7

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

Detect potential conflicts between any features that provide identical components.

3 calls to features_get_conflicts()
features_admin_components in ./features.admin.inc
Display the components of a feature.
features_admin_form in ./features.admin.inc
Form constructor for the features configuration form.
features_form_validate in ./features.admin.inc
Validate handler for the 'manage features' form.

File

./features.module, line 723
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_conflicts($reset = FALSE) {
  $conflicts = array();
  $component_info = features_get_components();
  $map = features_get_component_map(NULL, $reset);
  foreach ($map as $type => $components) {

    // Only check conflicts for components we know about.
    if (isset($component_info[$type])) {
      foreach ($components as $component => $modules) {
        if (isset($component_info[$type]['duplicates']) && $component_info[$type]['duplicates'] == FEATURES_DUPLICATES_ALLOWED) {
          continue;
        }
        else {
          if (count($modules) > 1) {
            foreach ($modules as $module) {
              if (!isset($conflicts[$module])) {
                $conflicts[$module] = array();
              }
              foreach ($modules as $m) {
                if ($m != $module) {
                  $conflicts[$module][$m][$type][] = $component;
                }
              }
            }
          }
        }
      }
    }
  }
  return $conflicts;
}