diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-01-26 18:55:43 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-01-26 18:55:43 +0000 |
commit | 68479ae77c1d14903a3ed9100339235407a59c31 (patch) | |
tree | ee649b5028a87edfaef069bb7aa904948c1053af | |
parent | c325e684cae8bd774e928e95b1e56a521fcd231e (diff) | |
download | brdo-68479ae77c1d14903a3ed9100339235407a59c31.tar.gz brdo-68479ae77c1d14903a3ed9100339235407a59c31.tar.bz2 |
- Fixed bug 5140: Drupal does not work with PHP 4.2.1 and cleaned up the
bootstrap code. Patch by Kjartan.
-rw-r--r-- | includes/module.inc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/includes/module.inc b/includes/module.inc index d6dc5f358..405face74 100644 --- a/includes/module.inc +++ b/includes/module.inc @@ -51,7 +51,12 @@ function module_list($refresh = 0, $bootstrap = 0) { if (!$list) { $list = array("admin" => "admin", "filter" => "filter", "system" => "system", "user" => "user", "watchdog" => "watchdog"); - $result = db_query("SELECT name, filename, throttle, bootstrap FROM {system} WHERE type = 'module' AND status = '1' ORDER BY name"); + if ($bootstrap) { + $result = db_query("SELECT name, filename, throttle, bootstrap FROM {system} WHERE type = 'module' AND status = 1 AND bootstrap = 1"); + } + else { + $result = db_query("SELECT name, filename, throttle, bootstrap FROM {system} WHERE type = 'module' AND status = 1"); + } while ($module = db_fetch_object($result)) { if (file_exists($module->filename)) { /* @@ -60,16 +65,13 @@ function module_list($refresh = 0, $bootstrap = 0) { ** throttle variables as the throttle.module may not be loaded yet. */ $throttle = ($module->throttle && variable_get("throttle_level", 0) > 4); - if ($bootstrap && !$throttle) { - $list[$module->name] = array("name"=> $module->name, "bootstrap" => $module->bootstrap, "filename" => $module->filename); - } - else if (!$throttle) { + if (!$throttle) { $list[$module->name] = $module->name; include_once $module->filename; } } } - natcasesort($list); + sort($list); } return $list; } |