summaryrefslogtreecommitdiff
path: root/includes/module.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-10-30 21:54:45 +0000
committerDries Buytaert <dries@buytaert.net>2009-10-30 21:54:45 +0000
commit1b8342019318f3fde4183d3d69fa29d8bdc4bc56 (patch)
tree7b0237bacd5cb60ea09fdaf4696aa4218c6a0436 /includes/module.inc
parent3d1058eb264f5269bfc268e94bb8de0c4aa5dc01 (diff)
downloadbrdo-1b8342019318f3fde4183d3d69fa29d8bdc4bc56.tar.gz
brdo-1b8342019318f3fde4183d3d69fa29d8bdc4bc56.tar.bz2
- Patch #615734 by catch: document why we call drupal_get_filename() in module_list().
Diffstat (limited to 'includes/module.inc')
-rw-r--r--includes/module.inc5
1 files changed, 5 insertions, 0 deletions
diff --git a/includes/module.inc b/includes/module.inc
index 0de05ae49..cd2821e4f 100644
--- a/includes/module.inc
+++ b/includes/module.inc
@@ -62,6 +62,11 @@ function module_list($refresh = FALSE, $bootstrap = FALSE, $sort = FALSE, $fixed
}
foreach ($result as $module) {
if (file_exists($module->filename)) {
+ // First call drupal_get_filename() to prime the static cache for
+ // later lookups of the module path. Since we've already queried for
+ // the filename and can pass that in as an argument, this avoids a
+ // database hit for every module when drupal_get_filename() is
+ // subsequently called by drupal_load().
drupal_get_filename('module', $module->name, $module->filename);
$list[$module->name] = $module->name;
}