function rules_features_providing_module in Rules 6
Retrieves the providing module for any items defined with rules hooks.
Parameters
$hook: The name of the hook without the 'rules_' prefix.
$name: The name of the item provided by the given hook.
Return value
The module name or FALSE if it can't be found.
2 calls to rules_features_providing_module()
- rules_features_process_rule in rules/
rules.export.inc - Processes a rule and identifes needed components or dependencies.
- _rules_features_process_rule in rules/
rules.export.inc - Helper to recursively process all elements of a rule.
File
- rules/
rules.export.inc, line 206 - Provides export functionality and integrates with the features module.
Code
function rules_features_providing_module($hook, $name) {
static $map = array();
if (!isset($map[$hook])) {
$map[$hook] = array();
foreach (module_implements('rules_' . $hook) as $module) {
if ($info = module_invoke($module, 'rules_' . $hook)) {
$map[$hook] += array_combine(array_keys($info), array_fill(0, count($info), $module));
}
}
}
return isset($map[$hook][$name]) ? $map[$hook][$name] : FALSE;
}