From 3cd9a1b2d48b0ad67d9a5a9569a6beb8939ec35a Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 1 Dec 2004 22:16:50 +0000 Subject: - 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). --- includes/bootstrap.inc | 3 +-- includes/common.inc | 4 ++-- includes/module.inc | 9 +++++++++ 3 files changed, 12 insertions(+), 4 deletions(-) (limited to 'includes') 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 @@ -6,6 +6,15 @@ * API for loading and interacting with Drupal modules. */ +/** + * 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. */ -- cgit v1.2.3