Commit 26710a4f00432290103b7eb934392430c67ff35f

Authored by Jarrett Jordaan
1 parent 903ffcea

Windows service update.

Committed by: Jarrett Jordaan

Reviewed by: Megan Watson
setup/wizard/lib/services/unixLucene.php
@@ -255,7 +255,7 @@ class unixLucene extends unixService { @@ -255,7 +255,7 @@ class unixLucene extends unixService {
255 $content .= "indexer.analyzer=org.apache.lucene.analysis.standard.StandardAnalyzer\n"; 255 $content .= "indexer.analyzer=org.apache.lucene.analysis.standard.StandardAnalyzer\n";
256 fwrite($fp, $content); 256 fwrite($fp, $content);
257 fclose($fp); 257 fclose($fp);
258 - @chmod($fileLoc, 0644); 258 + chmod($fileLoc, 0644);
259 } 259 }
260 } 260 }
261 ?> 261 ?>
262 \ No newline at end of file 262 \ No newline at end of file
setup/wizard/lib/services/windowsLucene.php
@@ -421,15 +421,16 @@ class windowsLucene extends windowsService { @@ -421,15 +421,16 @@ class windowsLucene extends windowsService {
421 */ 421 */
422 public function install() { 422 public function install() {
423 $state = $this->status(); 423 $state = $this->status();
424 - $luceneExe = $this->getLuceneExe();  
425 - $luceneSource = $this->getLuceneSource();  
426 - $luceneDir = $this->getluceneDir();  
427 - $cmd = "\"{$luceneExe}\""." -install \"".$this->getName()."\" \"".$this->getJavaJVM(). "\" -Djava.class.path=\"".$luceneSource."\"". " -start ".$this->getLuceneServer(). " -out \"".$this->getLuceneOut()."\" -err \"".$this->getLuceneError()."\" -current \"".$luceneDir."\" -auto";  
428 - if(DEBUG) {  
429 - echo "$cmd<br/>";  
430 - return false;  
431 - }  
432 - $this->writeLuceneInstall($cmd); 424 + $this->writeLuceneProperties();
  425 + $luceneExe = $this->getLuceneExe();
  426 + $luceneSource = $this->getLuceneSource();
  427 + $luceneDir = $this->getluceneDir();
  428 + $cmd = "\"{$luceneExe}\""." -install \"".$this->getName()."\" \"".$this->getJavaJVM(). "\" -Djava.class.path=\"".$luceneSource."\"". " -start ".$this->getLuceneServer(). " -out \"".$this->getLuceneOut()."\" -err \"".$this->getLuceneError()."\" -current \"".$luceneDir."\" -auto";
  429 + if(DEBUG) {
  430 + echo "$cmd<br/>";
  431 + return false;
  432 + }
  433 + $this->writeLuceneInstall($cmd);
433 return $state; 434 return $state;
434 } 435 }
435 436
@@ -471,5 +472,30 @@ class windowsLucene extends windowsService { @@ -471,5 +472,30 @@ class windowsLucene extends windowsService {
471 public function getStopMsg($installDir) { 472 public function getStopMsg($installDir) {
472 return "";//"Execute from command prompt : $installDir/dmsctl.bat stop"; 473 return "";//"Execute from command prompt : $installDir/dmsctl.bat stop";
473 } 474 }
  475 +
  476 + /**
  477 + * Write Lucene Service property file
  478 + *
  479 + * @author KnowledgeTree Team
  480 + * @access public
  481 + * @param none
  482 + * @return string
  483 + */
  484 + private function writeLuceneProperties() {
  485 + // Check if bin is readable and writable
  486 + $fileLoc = $this->getluceneDir()."KnowledgeTreeIndexer.properties";
  487 + $fp = fopen($fileLoc, "w+");
  488 + $content = "server.port=8875\n";
  489 + $content .= "server.paranoid=false\n";
  490 + $content .= "server.accept=127.0.0.1\n";
  491 + $content .= "server.deny=\n";
  492 + $conf = $this->util->getDataFromSession('configuration');
  493 + $varDirectory = $conf['paths']['varDirectory']['path'];
  494 + $content .= "indexer.directory=$varDirectory\n";
  495 + $content .= "indexer.analyzer=org.apache.lucene.analysis.standard.StandardAnalyzer\n";
  496 + fwrite($fp, $content);
  497 + fclose($fp);
  498 + chmod($fileLoc, 0644);
  499 + }
474 } 500 }
475 ?> 501 ?>
476 \ No newline at end of file 502 \ No newline at end of file