diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-11-25 06:14:59 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-11-25 06:14:59 +0000 |
commit | 5d0dfeb5620f6cb130a62381a634141d6a65af63 (patch) | |
tree | 7daa38baf096021655d21dc9ab0df394205f9a7f /includes/common.inc | |
parent | 4726c93156e59e0b44faf55845c3f97cf00a9168 (diff) | |
download | brdo-5d0dfeb5620f6cb130a62381a634141d6a65af63.tar.gz brdo-5d0dfeb5620f6cb130a62381a634141d6a65af63.tar.bz2 |
- Patch #13405 by Moshe:
+ Make bootstrap functionality work with HEAD.
+ Move functions into bootstrap.inc so that statistics_exit() works for cached pages. (Does this close any issues?)
Diffstat (limited to 'includes/common.inc')
-rw-r--r-- | includes/common.inc | 145 |
1 files changed, 2 insertions, 143 deletions
diff --git a/includes/common.inc b/includes/common.inc index 911549e0c..87ac73d4b 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 @@ -90,27 +65,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() { @@ -118,22 +72,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) { @@ -1819,54 +1757,6 @@ function drupal_eval($code) { } /** - * Returns and optionally sets the filename for a system item (module, - * theme, etc.). The filename, whether provided, cached, or retrieved - * from the database, is only returned if the file exists. - * - * @param $type - * The type of the item (i.e. theme, theme_engine, module). - * @param $name - * The name of the item for which the filename is requested. - * @param $filename - * The filename of the item if it is to be set explicitly rather - * than by consulting the database. - * - * @return - * The filename of the requested item. - */ -function drupal_get_filename($type, $name, $filename = NULL) { - static $files = array(); - - if (!$files[$type]) { - $files[$type] = array(); - } - - if ($filename && file_exists($filename)) { - $files[$type][$name] = $filename; - } - elseif ($files[$type][$name]) { - // nothing - } - elseif (($file = db_result(db_query("SELECT filename FROM {system} WHERE name = '%s' AND type = '%s'", $name, $type))) && file_exists($file)) { - $files[$type][$name] = $file; - } - else { - $config = conf_init(); - $dir = (($type == 'theme_engine') ? 'themes/engines' : "${type}s"); - $file = "$name.$type"; - - foreach (array("$config/$dir/$file", "$config/$dir/$name/$file", "$dir/$file", "$dir/$name/$file") as $file) { - if (file_exists($file)) { - $files[$type][$name] = $file; - break; - } - } - } - - return $files[$type][$name]; -} - -/** * Returns the path to a system item (module, theme, etc.). * * @param $type @@ -1881,37 +1771,6 @@ function drupal_get_path($type, $name) { return dirname(drupal_get_filename($type, $name)); } -/** - * Includes a file with the provided type and name. This prevents - * including a theme, engine, module, etc., more than once. - * - * @param $type - * The type of item to load (i.e. theme, theme_engine, module). - * @param $name - * The name of the item to load. - * - * @return - * TRUE if the item is loaded or has already been loaded. - */ -function drupal_load($type, $name) { - static $files = array(); - - if ($files[$type][$name]) { - return TRUE; - } - - $filename = drupal_get_filename($type, $name); - - if ($filename) { - include_once($filename); - $files[$type][$name] = TRUE; - - return TRUE; - } - - return FALSE; -} - include_once 'includes/theme.inc'; include_once 'includes/pager.inc'; include_once 'includes/menu.inc'; @@ -1933,8 +1792,8 @@ else { $_GET['q'] = drupal_get_normal_path(variable_get('site_frontpage', 'node')); } -// Initialize all enabled modules. -module_init(); +// Load all enabled modules. +module_load_all(); if ($_REQUEST && !user_access('bypass input data check')) { if (!valid_input_data($_REQUEST)) { |