From 4028362fda6f9423d95e53267fbd7ba99e96c106 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 26 Jan 2003 13:22:02 +0000 Subject: - Applied Moshe's _exit patch (slightly modified). - Fixed bug in system.module. --- includes/common.inc | 47 ++++++++--------------------------------------- 1 file changed, 8 insertions(+), 39 deletions(-) (limited to 'includes') diff --git a/includes/common.inc b/includes/common.inc index afc64fae3..65f994db2 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -462,13 +462,7 @@ function check_input($text) { } function filter($text) { - foreach (module_list() as $name) { - if (module_hook($name, "filter")) { - $text = module_invoke($name, "filter", $text); - } - } - - return $text; + return module_invoke_all("filter", $text);; } function rewrite_old_urls($text) { @@ -808,28 +802,14 @@ function link_page() { return $custom_links; } else { - $links[] = "". t("home") .""; - - foreach (module_list() as $name) { - if (module_hook($name, "link")) { - $links = array_merge($links, module_invoke($name, "link", "page")); - } - } - + $links = module_invoke_all("link", "page"); + array_unshift($links, "". t("home") .""); return $links; } } function link_node($node, $main = 0) { - $links = array(); - - foreach (module_list() as $name) { - if (module_hook($name, "link")) { - $links = array_merge($links, module_invoke($name, "link", "node", $node, $main)); - } - } - - return $links; + return module_invoke_all("link", "node", $node, $main); } function timer_start() { @@ -838,14 +818,6 @@ function timer_start() { $timer = (float)$usec + (float)$sec; } -function timer_print() { - global $timer; - list($usec, $sec) = explode(" ", microtime()); - $stop = (float)$usec + (float)$sec; - $diff = $stop - $timer; - print "
execution time: $diff sec
"; -} - function query_print() { global $queries; print "
";
@@ -877,17 +849,14 @@ function page_header() {
 }
 
 function page_footer() {
-  if (variable_get("dev_timer", 0)) {
-    timer_print();
-  }
-
-  if (variable_get("dev_query", 0)) {
-    query_print();
-  }
 
   if (variable_get("cache", 0)) {
     page_set_cache();
   }
+
+  // a hook for modules where modules may take action at the end of a request
+  // good uses include setting a cache, page logging, etc.
+  module_invoke_all("exit");
 }
 
 unset($conf);
-- 
cgit v1.2.3