Commit 8bd2a9ac599e7dcfc8148d2c1735a63c695198f0

Authored by Jarrett Jordaan
1 parent 6fd959d6

Lucene properties file written on the fly.

Committed by: Jarrett Jordaan

Reviewed by: Megan Watson
setup/wizard/lib/services/unixLucene.php
... ... @@ -201,6 +201,7 @@ class unixLucene extends unixService {
201 201 */
202 202 public function start() {
203 203 $state = $this->status();
  204 + $this->writeLuceneProperties();
204 205 if($state != 'STARTED') {
205 206 //$logFile = $this->outputDir."lucene.log";
206 207 $logFile = "/dev/null";//$this->outputDir."lucene.log";
... ... @@ -232,5 +233,29 @@ class unixLucene extends unixService {
232 233 return "";//"Execute from terminal : $installDir/dmsctl.sh stop";
233 234 }
234 235  
  236 + /**
  237 + * Write Lucene Service property file
  238 + *
  239 + * @author KnowledgeTree Team
  240 + * @access public
  241 + * @param none
  242 + * @return string
  243 + */
  244 + private function writeLuceneProperties() {
  245 + // Check if bin is readable and writable
  246 + $fileLoc = $this->getluceneDir()."KnowledgeTreeIndexer.properties";
  247 + $fp = fopen($fileLoc, "w+");
  248 + $content = "server.port=8875\n";
  249 + $content .= "server.paranoid=false\n";
  250 + $content .= "server.accept=127.0.0.1\n";
  251 + $content .= "server.deny=\n";
  252 + $conf = $this->util->getDataFromSession('configuration');
  253 + $varDirectory = $conf['paths']['varDirectory']['path'];
  254 + $content .= "indexer.directory=$varDirectory\n";
  255 + $content .= "indexer.analyzer=org.apache.lucene.analysis.standard.StandardAnalyzer\n";
  256 + fwrite($fp, $content);
  257 + fclose($fp);
  258 + $this->util->pexec("chmod 777 $fileLoc");
  259 + }
235 260 }
236 261 ?>
237 262 \ No newline at end of file
... ...