diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-12-01 22:16:50 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-12-01 22:16:50 +0000 |
commit | 3cd9a1b2d48b0ad67d9a5a9569a6beb8939ec35a (patch) | |
tree | 23b4c2649ce717cb8f812f04495dde98cb9e3c2b | |
parent | aa1413d82ef197396dbafda17fbc1596fce856fc (diff) | |
download | brdo-3cd9a1b2d48b0ad67d9a5a9569a6beb8939ec35a.tar.gz brdo-3cd9a1b2d48b0ad67d9a5a9569a6beb8939ec35a.tar.bz2 |
- Patch #13405 by Moshe: make you actually do something useful with the init hook. A recent patch to 4.5 and HEAD made this patch run too early in the request (for non-cached pages).
-rw-r--r-- | includes/bootstrap.inc | 3 | ||||
-rw-r--r-- | includes/common.inc | 4 | ||||
-rw-r--r-- | includes/module.inc | 9 |
3 files changed, 12 insertions, 4 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index f3f30bfc9..2f57a9294 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -402,11 +402,10 @@ function drupal_page_header() { if (variable_get('dev_timer', 0)) { timer_start(); } - bootstrap_invoke_all('init'); if (variable_get('cache', 0)) { if ($cache = page_get_cache()) { - + bootstrap_invoke_all('init'); // Set default values: $date = gmdate('D, d M Y H:i:s', $cache->created) .' GMT'; $etag = '"'. md5($date) .'"'; diff --git a/includes/common.inc b/includes/common.inc index be339f011..83e0a54e4 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -1793,8 +1793,8 @@ else { $_GET['q'] = drupal_get_normal_path(variable_get('site_frontpage', 'node')); } -// Load all enabled modules. -module_load_all(); +// Initialize all enabled modules. +module_init(); if ($_REQUEST && !user_access('bypass input data check')) { if (!valid_input_data($_REQUEST)) { diff --git a/includes/module.inc b/includes/module.inc index 8cfe216e3..d31222a98 100644 --- a/includes/module.inc +++ b/includes/module.inc @@ -7,6 +7,15 @@ */ /** + * Initialize all modules. + * + */ +function module_init() { + module_load_all(); + module_invoke_all('init'); +} + +/** * Call a function repeatedly with each module in turn as an argument. */ function module_iterate($function, $argument = '') { |