From 7367b36877bca568d785e01be802652b6a719884 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 14 Aug 2005 20:10:35 +0200 Subject: added stopword support to the indexer, added indexer webbug darcs-hash:20050814181035-7ad00-ed5d879d29fcee7f925f806456675605b058966a.gz --- inc/init.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'inc/init.php') 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,13 +93,29 @@ 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!"); } } +/** + * 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 * -- cgit v1.2.3