From 69a066c4cd70441a661846d1ca5774e7210c186a Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 3 Apr 2005 08:03:18 +0000 Subject: - Patch #19895 by Moshe: currently modules can inadvertently load all other modules during the bootstrap. this is easy to do by calling a node_load() or module_invoke_all(). this degrades performance for anonymous users when caching is enabled. With this patch, the module writer will see an php error like "Call to undefined function: drupal_set_html_head()" if this is attempted. basically, unavailable functions are actually reported as unavailable. --- includes/module.inc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'includes') diff --git a/includes/module.inc b/includes/module.inc index 6356fb137..1eb4aebe7 100644 --- a/includes/module.inc +++ b/includes/module.inc @@ -25,19 +25,20 @@ function module_iterate($function, $argument = '') { } /** - * Collect a list of all installed and enabled modules. + * Collect a list of all loaded modules. During the bootstrap, return only + * vital modules. See bootstrap.inc * * @param $refresh * Whether to force the module list to be regenerated (such as after the * administrator has changed the system settings). * @param $bootstrap - * Whether to return the reduced set of modules loaded in "bootstrap mode" for - * cached pages. See bootstrap.inc. + * Whether to return the reduced set of modules loaded in "bootstrap mode" + * for cached pages. See bootstrap.inc. * @return * An associative array whose keys and values are the names of all loaded * modules. */ -function module_list($refresh = FALSE, $bootstrap = FALSE) { +function module_list($refresh = FALSE, $bootstrap = TRUE) { static $list; if ($refresh) { -- cgit v1.2.3