summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDries Buytaert2004-11-25 06:12:35 (GMT)
committer Dries Buytaert2004-11-25 06:12:35 (GMT)
commit57ab8a9baf86e83ed94fd900f96f6e0a3c6a6ff7 (patch)
tree6a5f8d49068147a779d01953bc05b0e1b68e8b71
parente203a10ddf237795789507173ec428755a7474f6 (diff)
- Patch #13405 by Moshe (and jhrigs):
+ Fixed bug with previous commit. + Move functions into bootstrap.inc so that statistics_exit() works for cached pages. (Does this close any issues?)
-rw-r--r--includes/bootstrap.inc72
-rw-r--r--includes/common.inc62
-rw-r--r--includes/module.inc2
3 files changed, 73 insertions, 63 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 0134eae..63c331a 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -297,6 +297,78 @@ function bootstrap_invoke_all($op) {
}
/**
+ * Define the critical hooks that force modules to always be loaded.
+ */
+function bootstrap_hooks() {
+ return array('init', 'exit');
+}
+
+/**
+ * Given an internal Drupal path, return the alias set by the administrator.
+ */
+function drupal_get_path_alias($path) {
+ if (($map = drupal_get_path_map()) && ($newpath = array_search($path, $map))) {
+ return $newpath;
+ }
+ elseif (function_exists('conf_url_rewrite')) {
+ return conf_url_rewrite($path, 'outgoing');
+ }
+ else {
+ // No alias found. Return the normal path.
+ return $path;
+ }
+}
+
+/**
+ * Return an array mapping path aliases to their internal Drupal paths.
+ */
+function drupal_get_path_map($action = '') {
+ static $map = NULL;
+
+ if ($action == 'rebuild') {
+ $map = NULL;
+ }
+
+ if (is_null($map)) {
+ $map = array(); // Make $map non-null in case no aliases are defined.
+ $result = db_query('SELECT * FROM {url_alias}');
+ while ($data = db_fetch_object($result)) {
+ $map[$data->dst] = $data->src;
+ }
+ }
+
+ return $map;
+}
+
+/**
+ * Set the title of the current page, for display on the page and in the title bar.
+ */
+function drupal_set_title($title = NULL) {
+ static $stored_title;
+
+ if (isset($title)) {
+ $stored_title = $title;
+ }
+ return $stored_title;
+}
+
+/**
+ * Get the title of the current page, for display on the page and in the title bar.
+ */
+function drupal_get_title() {
+ $title = drupal_set_title();
+
+ if (!isset($title)) {
+ // titles cannot be determined when serving a cached page
+ if (function_exists('menu_get_active_title')) {
+ $title = menu_get_active_title();
+ }
+ }
+
+ return $title;
+}
+
+/**
* Unserializes and appends elements from a serialized string.
*
* @param $obj
diff --git a/includes/common.inc b/includes/common.inc
index 308eff9..c751abe 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -10,31 +10,6 @@
*/
/**
- * Set the title of the current page, for display on the page and in the title bar.
- */
-function drupal_set_title($title = NULL) {
- static $stored_title;
-
- if (isset($title)) {
- $stored_title = $title;
- }
- return $stored_title;
-}
-
-/**
- * Get the title of the current page, for display on the page and in the title bar.
- */
-function drupal_get_title() {
- $title = drupal_set_title();
-
- if (!isset($title)) {
- $title = menu_get_active_title();
- }
-
- return $title;
-}
-
-/**
* Set the breadcrumb trail for the current page.
*
* @param $breadcrumb
@@ -89,27 +64,6 @@ function drupal_get_html_head() {
}
/**
- * Return an array mapping path aliases to their internal Drupal paths.
- */
-function drupal_get_path_map($action = '') {
- static $map = NULL;
-
- if ($action == 'rebuild') {
- $map = NULL;
- }
-
- if (is_null($map)) {
- $map = array(); // Make $map non-null in case no aliases are defined.
- $result = db_query('SELECT * FROM {url_alias}');
- while ($data = db_fetch_object($result)) {
- $map[$data->dst] = $data->src;
- }
- }
-
- return $map;
-}
-
-/**
* Regenerate the path map from the information in the database.
*/
function drupal_rebuild_path_map() {
@@ -117,22 +71,6 @@ function drupal_rebuild_path_map() {
}
/**
- * Given an internal Drupal path, return the alias set by the administrator.
- */
-function drupal_get_path_alias($path) {
- if (($map = drupal_get_path_map()) && ($newpath = array_search($path, $map))) {
- return $newpath;
- }
- elseif (function_exists('conf_url_rewrite')) {
- return conf_url_rewrite($path, 'outgoing');
- }
- else {
- // No alias found. Return the normal path.
- return $path;
- }
-}
-
-/**
* Given a path alias, return the internal path it represents.
*/
function drupal_get_normal_path($path) {
diff --git a/includes/module.inc b/includes/module.inc
index fd7abf5..d5b74ec 100644
--- a/includes/module.inc
+++ b/includes/module.inc
@@ -42,7 +42,7 @@ function module_list($refresh = FALSE, $bootstrap = FALSE) {
static $list;
if ($refresh) {
- unset($list);
+ $list = array();
}
if (!$list) {