diff options
Diffstat (limited to 'inc/init.php')
-rw-r--r-- | inc/init.php | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/inc/init.php b/inc/init.php index 4e59cdbe1..d3afe1174 100644 --- a/inc/init.php +++ b/inc/init.php @@ -71,6 +71,7 @@ // make real paths and check them init_paths(); + init_files(); // automatic upgrade to script versions of certain files scriptify(DOKU_CONF.'users.auth'); @@ -92,7 +93,6 @@ function init_paths(){ 'changelog' => 'changes.log'); foreach($paths as $c => $p){ - if(!$conf[$c]) $conf[$c] = $conf['savedir'].'/'.$p; $conf[$c] = init_path($conf[$c]); if(!$conf[$c]) die("$c does not exist or isn't writable. Check config!"); @@ -100,6 +100,23 @@ function init_paths(){ } /** + * Checks the existance of certain files and creates them if missing + */ +function init_files(){ + global $conf; + $files = array( $conf['cachedir'].'/word.idx', + $conf['cachedir'].'/page.idx', + $conf['cachedir'].'/index.idx', ); + + foreach($files as $file){ + if(!@file_exists($file)){ + $fh = fopen($file,'a'); + fclose($fh); + } + } +} + +/** * returns absolute path * * This tries the given path first, then checks in DOKU_INC |