diff --git a/setup/wizard/lib/services/unixLucene.php b/setup/wizard/lib/services/unixLucene.php index ea5c97d..72dbd93 100644 --- a/setup/wizard/lib/services/unixLucene.php +++ b/setup/wizard/lib/services/unixLucene.php @@ -1,6 +1,6 @@ setLuceneSourceLoc("ktlucene.jar"); $this->setShutdownScript("shutdown.php"); } - - + + public function setIndexerDir($indexerDir) { $this->indexerDir = $indexerDir; } - + private function getIndexerDir() { return $this->indexerDir; } - + private function setShutdownScript($shutdownScript) { $this->shutdownScript = $shutdownScript; } - + public function getShutdownScript() { return $this->shutdownScript; } - + private function setLucenePidFile($lucenePidFile) { $this->lucenePidFile = $lucenePidFile; } - + private function getLucenePidFile() { return $this->lucenePidFile; } - + private function setLuceneDir($luceneDir) { $this->luceneDir = $luceneDir; } - + public function getLuceneDir() { return $this->luceneDir; } - + private function setJavaXms($javaXms) { $this->javaXms = "-Xms$javaXms"; } - + public function getJavaXms() { return $this->javaXms; } - + private function setJavaXmx($javaXmx) { $this->javaXmx = "-Xmx$javaXmx"; } - + public function getJavaXmx() { return $this->javaXmx; } - + private function setLuceneSource($luceneSource) { $this->luceneSource = $luceneSource; } - + public function getLuceneSource() { return $this->luceneSource; } - + private function setLuceneSourceLoc($luceneSourceLoc) { $this->luceneSourceLoc = $this->getLuceneDir().$luceneSourceLoc; } - + public function getLuceneSourceLoc() { return $this->luceneSourceLoc; } - + public function getJavaOptions() { return " {$this->getJavaXmx()} {$this->getJavaXmx()} -jar "; } - + /** * Stop Service * @@ -157,7 +157,7 @@ class unixLucene extends unixService { } return $state; } - + public function install() { $status = $this->status(); if($status == '') { @@ -166,7 +166,7 @@ class unixLucene extends unixService { return $status; } } - + public function status() { $cmd = "ps ax | grep ".$this->getLuceneSource(); $response = $this->util->pexec($cmd); @@ -183,14 +183,14 @@ class unixLucene extends unixService { return ''; } } - + return ''; } - + public function uninstall() { $this->stop(); } - + /** * Start Service * @@ -213,26 +213,26 @@ class unixLucene extends unixService { // return false; // } //$response = $this->util->pexec($cmd); - + // return $response; return false; } - + return true; } - + public function getName() { return $this->name; } - + public function getHRName() { return $this->hrname; } - + public function getStopMsg($installDir) { return "";//"Execute from terminal : $installDir/dmsctl.sh stop"; } - + /** * Write Lucene Service property file * @@ -251,7 +251,7 @@ class unixLucene extends unixService { $content .= "server.deny=\n"; $conf = $this->util->getDataFromSession('configuration'); $varDirectory = $conf['paths']['varDirectory']['path']; - $content .= "indexer.directory=$varDirectory\n"; + $content .= "indexer.directory=$varDirectory" . DIRECTORY_SEPARATOR . "indexes\n"; $content .= "indexer.analyzer=org.apache.lucene.analysis.standard.StandardAnalyzer\n"; fwrite($fp, $content); fclose($fp); diff --git a/setup/wizard/lib/services/windowsLucene.php b/setup/wizard/lib/services/windowsLucene.php index 4a8c4a2..8f6787a 100644 --- a/setup/wizard/lib/services/windowsLucene.php +++ b/setup/wizard/lib/services/windowsLucene.php @@ -5,7 +5,7 @@ * KnowledgeTree Community Edition * Document Management Made Simple * Copyright (C) 2008,2009 KnowledgeTree Inc. -* +* * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License version 3 as published by the @@ -135,7 +135,7 @@ class windowsLucene extends windowsService { public $hrname = "KnowledgeTree Indexer Service. (KTLucene)"; public $description = "KnowledgeTree Indexer Service."; - + /** * Load defaults needed by service * @@ -464,15 +464,15 @@ class windowsLucene extends windowsService { return ''; } - + public function getHRName() { return $this->hrname; } - + public function getStopMsg($installDir) { return "";//"Execute from command prompt : $installDir/dmsctl.bat stop"; } - + /** * Write Lucene Service property file * @@ -491,7 +491,7 @@ class windowsLucene extends windowsService { $content .= "server.deny=\n"; $conf = $this->util->getDataFromSession('configuration'); $varDirectory = $conf['paths']['varDirectory']['path']; - $content .= "indexer.directory=$varDirectory\n"; + $content .= "indexer.directory=$varDirectory" . DIRECTORY_SEPARATOR . "indexes\n"; $content .= "indexer.analyzer=org.apache.lucene.analysis.standard.StandardAnalyzer\n"; fwrite($fp, $content); fclose($fp); diff --git a/setup/wizard/steps/install.php b/setup/wizard/steps/install.php index e30ba6a..247ce53 100644 --- a/setup/wizard/steps/install.php +++ b/setup/wizard/steps/install.php @@ -105,10 +105,15 @@ class install extends step { $this->callHome(); if ($this->util->isMigration()) { // copy indexing directory if this is a migration - $migrateSessionData = $this->getDataFromPackage('migrate', 'installation'); - $configSessionData = $this->getDataFromSession('configuration'); + $migrateSessionData = $this->getDataFromPackage('migrate', 'installation'); + $configSessionData = $this->getDataFromSession('configuration'); $src = $migrateSessionData['location'] . DS . 'var' . DS . 'indexes'; - $dst = $configSessionData['paths']['varDirectory']['path'] . DS . 'indexes'; + + if(WINDOWS_OS){ + $dst = $configSessionData['paths']['varDirectory']['path'] . DS . 'indexes'; + }else{ + $dst = $configSessionData['paths']['varDirectory']['path']; + } $this->util->copyDirectory($src, $dst); } } @@ -126,11 +131,11 @@ class install extends step } $this->temp_variables['ce_check'] = $this->ce_check; } - + function registerPlugins() { - + } - + public function callHome() { $conf = $this->getDataFromSession("install"); // retrieve database information from session $dbconf = $this->getDataFromSession("database"); @@ -143,7 +148,7 @@ class install extends step $this->util->dbUtilities->query($query); $this->util->dbUtilities->close(); // close the database connection } - - + + } ?> \ No newline at end of file