function features_get_conflicts in Features 6
Same name and namespace in other branches
- 7.2 features.module \features_get_conflicts()
- 7 features.module \features_get_conflicts()
Detect potential conflicts between any features that provide identical components.
3 calls to features_get_conflicts()
- features_admin_form in ./
features.admin.inc - admin/build/features page callback.
- features_form_validate in ./
features.admin.inc - Validate handler for the 'manage features' form.
- template_preprocess_features_admin_components in theme/
theme.inc - Display feature component info
File
- ./
features.module, line 561 - 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;
}