summaryrefslogtreecommitdiff
path: root/inc/init.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2005-08-14 20:10:35 +0200
committerAndreas Gohr <andi@splitbrain.org>2005-08-14 20:10:35 +0200
commit7367b36877bca568d785e01be802652b6a719884 (patch)
treea1e27b5806ba835d43f69373cf83247953cd1ee1 /inc/init.php
parent48665d389b9bb386283c08172b24f3af26628bce (diff)
downloadrpg-7367b36877bca568d785e01be802652b6a719884.tar.gz
rpg-7367b36877bca568d785e01be802652b6a719884.tar.bz2
added stopword support to the indexer, added indexer webbug
darcs-hash:20050814181035-7ad00-ed5d879d29fcee7f925f806456675605b058966a.gz
Diffstat (limited to 'inc/init.php')
-rw-r--r--inc/init.php19
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