Commit 77d695fe authored by Dries's avatar Dries

- Patch #69341 by chx: remove some SQL queries from the Drupal bootstrap process.

parent 824e7d4d
...@@ -339,7 +339,7 @@ function page_get_cache() { ...@@ -339,7 +339,7 @@ function page_get_cache() {
* The name of the bootstrap hook we wish to invoke. * The name of the bootstrap hook we wish to invoke.
*/ */
function bootstrap_invoke_all($hook) { function bootstrap_invoke_all($hook) {
foreach (module_list(FALSE, TRUE) as $module) { foreach (module_list(TRUE, TRUE) as $module) {
drupal_load('module', $module); drupal_load('module', $module);
module_invoke($module, $hook); module_invoke($module, $hook);
} }
......
...@@ -45,12 +45,8 @@ function module_list($refresh = FALSE, $bootstrap = TRUE, $sort = FALSE) { ...@@ -45,12 +45,8 @@ function module_list($refresh = FALSE, $bootstrap = TRUE, $sort = FALSE) {
static $list, $sorted_list; static $list, $sorted_list;
if ($refresh) { if ($refresh) {
unset($sorted_list);
$list = array(); $list = array();
$sorted_list = NULL;
}
if (!$list) {
$list = array('filter' => 'filter', 'node' => 'node', 'system' => 'system', 'user' => 'user', 'watchdog' => 'watchdog');
if ($bootstrap) { if ($bootstrap) {
$result = db_query("SELECT name, filename, throttle, bootstrap FROM {system} WHERE type = 'module' AND status = 1 AND bootstrap = 1 ORDER BY weight ASC, filename ASC"); $result = db_query("SELECT name, filename, throttle, bootstrap FROM {system} WHERE type = 'module' AND status = 1 AND bootstrap = 1 ORDER BY weight ASC, filename ASC");
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment