You are here

function rules_features_process_rule in Rules 6

Processes a rule and identifes needed components or dependencies.

2 calls to rules_features_process_rule()
rules_categories_features_export in rules/rules.export.inc
Implementation of hook_features_export() for categories.
rules_features_process_set in rules/rules.export.inc
Retrieves all necessary module dependencies for a list of rule sets.

File

rules/rules.export.inc, line 156
Provides export functionality and integrates with the features module.

Code

function rules_features_process_rule($rule, &$export, &$pipe) {
  $dependencies = array();

  // If it is an event-triggered rule, add event dependencies
  if (strpos($rule['#set'], 'event_') === 0) {
    $event = substr($rule['#set'], strlen('event_'));
    if ($module = rules_features_providing_module('event_info', $event)) {
      $export['dependencies'][$module] = $module;
    }
  }
  foreach (array(
    'condition',
    'action',
  ) as $type) {
    _rules_features_process_rule((array) $rule['#' . $type . 's'], $export, $pipe);
  }
}