diff options
author | Ben Coburn <btcoburn@silicodon.net> | 2006-08-28 09:12:05 +0200 |
---|---|---|
committer | Ben Coburn <btcoburn@silicodon.net> | 2006-08-28 09:12:05 +0200 |
commit | 50602150cdefc713863f182b761885259f3734b7 (patch) | |
tree | a6d2ee2dba4440df2740480a28203a9919a87387 | |
parent | bb4e0b0b87ce6a0701a60ced1d2950bf1cbed861 (diff) | |
download | rpg-50602150cdefc713863f182b761885259f3734b7.tar.gz rpg-50602150cdefc713863f182b761885259f3734b7.tar.bz2 |
init global memory cache arrays
Update to 'add function result caching for cleanID and wikiFN'.
Makes certain that arrays exist for the caches, without checking on each function call.
Properly create multidimensional arrays in wikiFN().
darcs-hash:20060828071205-05dcb-7c8dbdb5ea4e7b73808ec3bd9222df1b837d3a1f.gz
-rw-r--r-- | inc/init.php | 4 | ||||
-rw-r--r-- | inc/pageutils.php | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/inc/init.php b/inc/init.php index 354e0de8a..13fb3a4bb 100644 --- a/inc/init.php +++ b/inc/init.php @@ -23,6 +23,10 @@ if (!defined('DOKU_E_LEVEL')) { error_reporting(E_ALL ^ E_NOTICE); } else { error_reporting(DOKU_E_LEVEL); } + // init memory caches + $cache_wikifn = array(); + $cache_cleanid = array(); + //prepare config array() global $conf; if (!defined('DOKU_UNITTEST')) { diff --git a/inc/pageutils.php b/inc/pageutils.php index 882a6bf56..758d34a9e 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -188,6 +188,7 @@ function wikiFN($raw_id,$rev='',$clean=true){ } } + if (!isset($cache[$raw_id])) { $cache[$raw_id] = array(); } $cache[$raw_id][$rev] = $fn; return $fn; } |