- Patch #615734 by catch: document why we call drupal_get_filename() in module_list().

merge-requests/26/head
Dries Buytaert 2009-10-30 21:54:45 +00:00
parent 3d1058eb26
commit 1b83420193
1 changed files with 5 additions and 0 deletions

View File

@ -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;
}