summaryrefslogtreecommitdiff
path: root/includes/registry.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-06-08 09:23:55 +0000
committerDries Buytaert <dries@buytaert.net>2009-06-08 09:23:55 +0000
commite9d97f1eef493de9b9cb3ae456175ce33b5cb796 (patch)
tree3796e7622e33162c71567c48785b887d2f9f433e /includes/registry.inc
parentb9ed1bc6e64fe82019c92cb582feb0b396dc96a7 (diff)
downloadbrdo-e9d97f1eef493de9b9cb3ae456175ce33b5cb796.tar.gz
brdo-e9d97f1eef493de9b9cb3ae456175ce33b5cb796.tar.bz2
- Patch #449198 by boombatower: cealn up test loading and related API.
Diffstat (limited to 'includes/registry.inc')
-rw-r--r--includes/registry.inc23
1 files changed, 19 insertions, 4 deletions
diff --git a/includes/registry.inc b/includes/registry.inc
index cfc7ae118..89de42356 100644
--- a/includes/registry.inc
+++ b/includes/registry.inc
@@ -45,11 +45,19 @@ function _registry_rebuild() {
system_get_files_database($modules, 'module');
// Get the list of files we are going to parse.
$files = array();
- foreach ($modules as $module) {
+ foreach ($modules as &$module) {
+ $dir = dirname($module->filepath);
+
+ // Store the module directory for use in hook_registry_files_alter().
+ $module->dir = $dir;
+
+ // Parse the .info file for all modules, reguardless of their status so the
+ // list of files can then be used in hook_registry_files_alter()
+ // implementations.
+ $module->info = drupal_parse_info_file($dir . '/' . $module->name . '.info');
+
if ($module->status) {
- // Parse .info file only for enabled modules.
- $module->info = drupal_parse_info_file(dirname($module->filepath) . '/' . $module->name . '.info');
- $dir = dirname($module->filepath);
+ // Add files for enabled modules to the registry.
foreach ($module->info['files'] as $file) {
$files["$dir/$file"] = array('module' => $module->name, 'weight' => $module->weight);
}
@@ -59,6 +67,13 @@ function _registry_rebuild() {
$files["$filename"] = array('module' => '', 'weight' => 0);
}
+ // Allow modules to manually modify the list of files before the registry
+ // parses them. The $modules array provides the .info file information, which
+ // includes the list of files registered to each module. Any files in the
+ // list can then be added to the list of files that the registry will parse,
+ // or modify attributes of a file.
+ drupal_alter('registry_files', $files, $modules);
+
foreach (registry_get_parsed_files() as $filename => $file) {
// Add the md5 to those files we've already parsed.
if (isset($files[$filename])) {