diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-10-09 17:22:22 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-10-09 17:22:22 +0000 |
commit | d2175fdcbd1b9703c83050f626e802bef02b5116 (patch) | |
tree | fad9c62d2ea822935b2e8089ffc417d23698fbf6 /includes/common.inc | |
parent | f2a9d01de29918717080dac4ea8718da845f203f (diff) | |
download | brdo-d2175fdcbd1b9703c83050f626e802bef02b5116.tar.gz brdo-d2175fdcbd1b9703c83050f626e802bef02b5116.tar.bz2 |
- Fixed cache issue with path map.
Diffstat (limited to 'includes/common.inc')
-rw-r--r-- | includes/common.inc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/includes/common.inc b/includes/common.inc index a04115a55..b58bb749f 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -29,17 +29,25 @@ function conf_init() { * Build the alias/path array */ function drupal_get_path_map($action = "") { + + static $cache; static $map; if ($action == "rebuild") { $map = NULL; + $cache = 0; } - if (empty($map)) { - $result = db_query("SELECT * FROM {path}"); + if (!$cache) { + if (!$result) { + $result = db_query("SELECT * FROM {path}"); + } + while ($data = db_fetch_object($result)) { $map[$data->dst] = $data->src; } + + $cache = 1; } return $map; |