function RulesAbstractPlugin::includeFiles
Makes sure all supported destinations are included.
2 calls to RulesAbstractPlugin::includeFiles()
- RulesAbstractPlugin::rebuildCache in includes/
rules.core.inc - Add in the data provided by the info hooks to the cache.
- rules_discover_plugins in ./
rules.module - Discover plugin implementations.
File
-
includes/
rules.core.inc, line 1827
Class
- RulesAbstractPlugin
- Defines a common base class for so-called "Abstract Plugins" like actions.
Code
public static function includeFiles() {
static $included;
if (!isset($included)) {
foreach (module_implements('rules_file_info') as $module) {
// rules.inc are already included thanks to the rules_hook_info() group.
foreach (self::getIncludeFiles($module, FALSE) as $name) {
module_load_include('inc', $module, $name);
}
}
$dirs = array();
foreach (module_implements('rules_directory') as $module) {
// Include all files once, so the discovery can find them.
$result = module_invoke($module, 'rules_directory');
if (!is_array($result)) {
$result = array(
$module => $result,
);
}
$dirs += $result;
}
foreach ($dirs as $module => $directory) {
$module_path = drupal_get_path('module', $module);
foreach (array(
'inc',
'php',
) as $extension) {
foreach (glob("{$module_path}/{$directory}/*.{$extension}") as $filename) {
include_once $filename;
}
}
}
$included = TRUE;
}
}