From 8bd2a9ac599e7dcfc8148d2c1735a63c695198f0 Mon Sep 17 00:00:00 2001 From: Jarrett Jordaan Date: Fri, 27 Nov 2009 16:55:41 +0200 Subject: [PATCH] Lucene properties file written on the fly. --- setup/wizard/lib/services/unixLucene.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+), 0 deletions(-) diff --git a/setup/wizard/lib/services/unixLucene.php b/setup/wizard/lib/services/unixLucene.php index b751115..960d6b1 100644 --- a/setup/wizard/lib/services/unixLucene.php +++ b/setup/wizard/lib/services/unixLucene.php @@ -201,6 +201,7 @@ class unixLucene extends unixService { */ public function start() { $state = $this->status(); + $this->writeLuceneProperties(); if($state != 'STARTED') { //$logFile = $this->outputDir."lucene.log"; $logFile = "/dev/null";//$this->outputDir."lucene.log"; @@ -232,5 +233,29 @@ class unixLucene extends unixService { return "";//"Execute from terminal : $installDir/dmsctl.sh stop"; } + /** + * Write Lucene Service property file + * + * @author KnowledgeTree Team + * @access public + * @param none + * @return string + */ + private function writeLuceneProperties() { + // Check if bin is readable and writable + $fileLoc = $this->getluceneDir()."KnowledgeTreeIndexer.properties"; + $fp = fopen($fileLoc, "w+"); + $content = "server.port=8875\n"; + $content .= "server.paranoid=false\n"; + $content .= "server.accept=127.0.0.1\n"; + $content .= "server.deny=\n"; + $conf = $this->util->getDataFromSession('configuration'); + $varDirectory = $conf['paths']['varDirectory']['path']; + $content .= "indexer.directory=$varDirectory\n"; + $content .= "indexer.analyzer=org.apache.lucene.analysis.standard.StandardAnalyzer\n"; + fwrite($fp, $content); + fclose($fp); + $this->util->pexec("chmod 777 $fileLoc"); + } } ?> \ No newline at end of file -- libgit2 0.21.4