summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-04-03 08:03:18 +0000
committerDries Buytaert <dries@buytaert.net>2005-04-03 08:03:18 +0000
commit69a066c4cd70441a661846d1ca5774e7210c186a (patch)
treed9afc1129274f213478f478df36ff648412d46a8
parentf98bbea2f0b636ccd6b1d768b289b2ac90993306 (diff)
downloadbrdo-69a066c4cd70441a661846d1ca5774e7210c186a.tar.gz
brdo-69a066c4cd70441a661846d1ca5774e7210c186a.tar.bz2
- 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.
-rw-r--r--includes/module.inc9
1 files changed, 5 insertions, 4 deletions
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) {