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
This commit is contained in:
Ben Coburn 2006-08-28 09:12:05 +02:00
parent bb4e0b0b87
commit 50602150cd
2 changed files with 5 additions and 0 deletions

View File

@ -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')) {

View File

@ -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;
}