diff --git a/setup/migrate/templates/installation.tpl b/setup/migrate/templates/installation.tpl index 66ba0a4..6848354 100644 --- a/setup/migrate/templates/installation.tpl +++ b/setup/migrate/templates/installation.tpl @@ -31,7 +31,7 @@ Please verify the location of your current installation.

- +

- \ No newline at end of file + + \ No newline at end of file diff --git a/setup/migrate/templates/installation_confirm.tpl b/setup/migrate/templates/installation_confirm.tpl index 429b033..52312a2 100644 --- a/setup/migrate/templates/installation_confirm.tpl +++ b/setup/migrate/templates/installation_confirm.tpl @@ -38,10 +38,6 @@ Database Name: - - Database Name: - -

System Paths

diff --git a/setup/wizard/dbUtil.php b/setup/wizard/dbUtil.php index 8a6fbf3..349f65a 100644 --- a/setup/wizard/dbUtil.php +++ b/setup/wizard/dbUtil.php @@ -121,6 +121,9 @@ class dbUtil { } } + public function getDatabaseLink() { + return $this->dbconnection; + } /** * Choose a database to use * diff --git a/setup/wizard/installUtil.php b/setup/wizard/installUtil.php index 099461a..3df47c2 100644 --- a/setup/wizard/installUtil.php +++ b/setup/wizard/installUtil.php @@ -555,7 +555,15 @@ class InstallUtil { return $res; } $cmd = "which php"; - return $this->getPhpHelper($cmd); + $res = $this->getPhpHelper($cmd); + if($res != '') { + return $res; + } + if(file_exists(PHP_DIR."php")) { + return PHP_DIR."php"; + } + + return 'php'; } function getPhpHelper($cmd) { diff --git a/setup/wizard/lib/helpers/demo.sh b/setup/wizard/lib/helpers/demo.sh old mode 100644 new mode 100755 index 7f6fc6f..a62fb78 --- a/setup/wizard/lib/helpers/demo.sh +++ b/setup/wizard/lib/helpers/demo.sh @@ -1,11 +1,12 @@ #!/bin/bash -rm ../../../../bin/schedulerTask.sh; rm ../../../../var/log/lucene.log; rm ../../../../var/log/scheduler.log; rm ../../../../var/log/openoffice.log; -rm ../../../../bin/luceneserver/KnowledgeTreeIndexer.properties; rm ../../../../setup/wizard/output/outJV; -pkill -f lucene; -pkill -f scheduler; -pkill -f openoffice; - +chmod 777 -R /var/lib/knowledgetree +chmod 777 -R /var/log/knowledgetree +chmod 777 -R /var/tmp/knowledgetree +chmod 777 -R /var/lib/knowledgetree/Documents +chmod 777 -R /var/lib/knowledgetree/indexes +chmod 777 -R /var/lib/knowledgetree/proxies +chmod 777 -R /var/lib/knowledgetree/uploads diff --git a/setup/wizard/lib/services/unixAgent.php b/setup/wizard/lib/services/unixAgent.php index 9fa283d..340c9be 100644 --- a/setup/wizard/lib/services/unixAgent.php +++ b/setup/wizard/lib/services/unixAgent.php @@ -42,9 +42,7 @@ class unixAgent extends unixService { - public function __construct() { - $this->name = "KTAgentTest"; - } + public $name = "KTAgentTest"; } diff --git a/setup/wizard/lib/services/unixLucene.php b/setup/wizard/lib/services/unixLucene.php index 89e8ad0..697fbe7 100644 --- a/setup/wizard/lib/services/unixLucene.php +++ b/setup/wizard/lib/services/unixLucene.php @@ -42,7 +42,6 @@ class unixLucene extends unixService { public $util; - private $shutdownScript; private $indexerDir; private $lucenePidFile; @@ -51,14 +50,11 @@ class unixLucene extends unixService { private $luceneSourceLoc; private $javaXms; private $javaXmx; - - public function __construct() { - $this->name = "KTLuceneTest"; - $this->setLuceneSource("ktlucene.jar"); - $this->util = new InstallUtil(); - } + public $name = "KTLuceneTest"; public function load() { + $this->util = new InstallUtil(); + $this->setLuceneSource("ktlucene.jar"); $this->setLuceneDir(SYSTEM_DIR."bin".DS."luceneserver".DS); $this->setIndexerDir(SYSTEM_DIR."search2".DS."indexing".DS."bin".DS); $this->setLucenePidFile("lucene_test.pid"); diff --git a/setup/wizard/lib/services/unixOpenOffice.php b/setup/wizard/lib/services/unixOpenOffice.php index 261354d..bc0c978 100644 --- a/setup/wizard/lib/services/unixOpenOffice.php +++ b/setup/wizard/lib/services/unixOpenOffice.php @@ -60,15 +60,11 @@ class unixOpenOffice extends unixService { private $log; private $options; private $office; + public $name = "KTOpenOffice"; - public function __construct() { - $this->name = "KTOpenOffice"; + public function load() { $this->util = new InstallUtil(); $this->office = 'openoffice'; - } - - public function load() { - $this->setPort("8100"); $this->setHost("localhost"); $this->setLog("openoffice.log"); @@ -76,8 +72,6 @@ class unixOpenOffice extends unixService { $this->setOption(); } - - private function setPort($port = "8100") { $this->port = $port; } diff --git a/setup/wizard/lib/services/unixScheduler.php b/setup/wizard/lib/services/unixScheduler.php index 8a58038..71e6636 100644 --- a/setup/wizard/lib/services/unixScheduler.php +++ b/setup/wizard/lib/services/unixScheduler.php @@ -46,20 +46,22 @@ class unixScheduler extends unixService { private $schedulerSourceLoc; private $systemDir; private $scheduler; + private $phpCli; + public $name = "KTSchedulerTest"; - public function __construct() { - $this->name = "KTSchedulerTest"; + public function load() { $this->util = new InstallUtil(); + $this->setPhpCli(); $this->scheduler = 'scheduler'; $this->setSchedulerSource('schedulerTask.sh'); - } - - public function load() { $this->setSystemDir(SYSTEM_ROOT."bin".DS); $this->setSchedulerDir(VAR_BIN_DIR); $this->setSchedulerSourceLoc('schedulerTask.sh'); } + function setPhpCli() { + $this->phpCli = $this->util->getPhp(); + } function setSystemDir($systemDir) { $this->systemDir = $systemDir; @@ -104,7 +106,7 @@ class unixScheduler extends unixService { $content .= "cd ".$this->getSchedulerDir()."\n"; $content .= "while true; do\n"; // TODO : This will not work without CLI - $content .= "php -Cq scheduler.php\n"; + $content .= "{$this->phpCli} -Cq scheduler.php\n"; $content .= "sleep 30\n"; $content .= "done"; @fwrite($fp, $content); @@ -169,8 +171,6 @@ class unixScheduler extends unixService { return $response; } - - - + } ?> diff --git a/setup/wizard/lib/services/windowsLucene.php b/setup/wizard/lib/services/windowsLucene.php index 7eeda2a..4938db0 100644 --- a/setup/wizard/lib/services/windowsLucene.php +++ b/setup/wizard/lib/services/windowsLucene.php @@ -141,7 +141,6 @@ class windowsLucene extends windowsService { * @return void */ public function load() { - $this->setJavaBin(); $this->setLuceneDIR(SYSTEM_DIR."bin".DS."luceneserver"); $this->setLuceneExe("KTLuceneService.exe"); diff --git a/setup/wizard/openoffice.log b/setup/wizard/openoffice.log new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/setup/wizard/openoffice.log diff --git a/setup/wizard/path.php b/setup/wizard/path.php index b0699c1..a20968d 100644 --- a/setup/wizard/path.php +++ b/setup/wizard/path.php @@ -96,28 +96,33 @@ // Install Type preg_match('/Zend/', $sys, $matches); // TODO: Dirty if($matches) { - $sysdir = explode(DS, $sys); - array_pop($sysdir); - array_pop($sysdir); - array_pop($sysdir); - array_pop($sysdir); - $zendsys = ''; - foreach ($sysdir as $k=>$v) { - $zendsys .= $v.DS; - } define('INSTALL_TYPE', 'Zend'); - define('PHP_DIR', $zendsys."ZendServer".DS."bin".DS); } else { $modules = get_loaded_extensions(); - // TODO: Dirty if(in_array('Zend Download Server', $modules) || in_array('Zend Monitor', $modules) || in_array('Zend Utils', $modules) || in_array('Zend Page Cache', $modules)) { define('INSTALL_TYPE', 'Zend'); - define('PHP_DIR', ''); } else { - define('INSTALL_TYPE', ''); - define('PHP_DIR', ''); + define('INSTALL_TYPE', 'Source'); } } + if(INSTALL_TYPE == 'Zend') { + if(WINDOWS_OS) { + $sysdir = explode(DS, $sys); + array_pop($sysdir); + array_pop($sysdir); + array_pop($sysdir); + array_pop($sysdir); + $zendsys = ''; + foreach ($sysdir as $k=>$v) { + $zendsys .= $v.DS; + } + define('PHP_DIR', $zendsys."ZendServer".DS."bin".DS); + } else { + define('PHP_DIR', DS."usr".DS."local".DS."zend".DS."bin".DS); + } + } else { + define('PHP_DIR', ''); + } // Other date_default_timezone_set('Africa/Johannesburg'); if(WINDOWS_OS) { // Mysql bin [Windows] diff --git a/setup/wizard/scheduler.log b/setup/wizard/scheduler.log new file mode 100644 index 0000000..ee66ebc --- /dev/null +++ b/setup/wizard/scheduler.log @@ -0,0 +1,53 @@ +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found diff --git a/setup/wizard/steps/complete.php b/setup/wizard/steps/complete.php index 5db5d24..f663f67 100644 --- a/setup/wizard/steps/complete.php +++ b/setup/wizard/steps/complete.php @@ -226,6 +226,7 @@ class complete extends Step { foreach ($services->getServices() as $serviceName) { $className = OS.$serviceName; $service = new $className(); + $service->load(); $status = $services->serviceStarted($service); if($status) { $this->temp_variables[$serviceName."Status"] = 'tick'; diff --git a/setup/wizard/steps/configuration.php b/setup/wizard/steps/configuration.php index d94396b..317793f 100644 --- a/setup/wizard/steps/configuration.php +++ b/setup/wizard/steps/configuration.php @@ -308,11 +308,14 @@ class configuration extends Step private function registerDirs() { // Adjust directories variables $this->readConfigPath(); $dirs = $this->getFromConfigPath(); - $directories['varDirectory'] = array('section'=>'urls', 'value'=>mysql_real_escape_string($dirs['varDirectory']['path']), 'setting'=>'varDirectory'); - $directories['logDirectory'] = array('section'=>'urls', 'value'=>mysql_real_escape_string($dirs['logDirectory']['path']), 'setting'=>'logDirectory'); - $directories['documentRoot'] = array('section'=>'urls', 'value'=>mysql_real_escape_string($dirs['documentRoot']['path']), 'setting'=>'documentRoot'); + $dbconf = $this->getDataFromSession("database"); // retrieve database information from session + $this->_dbhandler->load($dbconf['dhost'], $dbconf['duname'], $dbconf['dpassword'], $dbconf['dname']); // initialise the db connection + //$this->_dbhandler->getDatabaseLink() + $directories['varDirectory'] = array('section'=>'urls', 'value'=>addslashes($dirs['varDirectory']['path']), 'setting'=>'varDirectory'); + $directories['logDirectory'] = array('section'=>'urls', 'value'=>addslashes($dirs['logDirectory']['path']), 'setting'=>'logDirectory'); + $directories['documentRoot'] = array('section'=>'urls', 'value'=>addslashes($dirs['documentRoot']['path']), 'setting'=>'documentRoot'); $directories['uiDirectory'] = array('section'=>'urls', 'value'=>'${fileSystemRoot}/presentation/lookAndFeel/knowledgeTree', 'setting'=>'uiDirectory'); - $directories['tmpDirectory'] = array('section'=>'urls', 'value'=>mysql_real_escape_string($dirs['tmpDirectory']['path']), 'setting'=>'tmpDirectory'); + $directories['tmpDirectory'] = array('section'=>'urls', 'value'=>addslashes($dirs['tmpDirectory']['path']), 'setting'=>'tmpDirectory'); return $directories; } diff --git a/setup/wizard/steps/services.php b/setup/wizard/steps/services.php index 761f13b..8bef14a 100644 --- a/setup/wizard/steps/services.php +++ b/setup/wizard/steps/services.php @@ -412,7 +412,7 @@ class services extends Step $this->presetOpenOffice(); if(!$this->schedulerInstalled) { if(!WINDOWS_OS) $this->php = $this->util->getPhp(); // Get java, if it exists - $passedPhp = $this->phpChecks(); // Run Java Pre Checks + $passedPhp = $this->phpChecks(); // Run Php Pre Checks if ($passedPhp) { // Install Scheduler $this->installService('Scheduler'); } @@ -430,11 +430,11 @@ class services extends Step } if(!$this->openOfficeInstalled) { if(!WINDOWS_OS) $this->soffice = $this->util->getOpenOffice(); // Get java, if it exists - $passedOpenOffice = $this->openOfficeChecks(); // Run Java Pre Checks + $passedOpenOffice = $this->openOfficeChecks(); // Run Office Pre Checks if ($passedOpenOffice) { //Install OpenOffice // $this->temp_variables['openOfficeExe'] = $this->soffice; // TODO : Why, O, why? - $this->openOfficeExeError = false; + $this->openOfficeInstalled(); $_SESSION[$this->salt]['services']['openOfficeExe'] = $this->soffice; $this->installService('OpenOffice'); } @@ -510,6 +510,7 @@ class services extends Step foreach ($serverDetails as $serviceName) { $className = OS.$serviceName; $service = new $className(); + $service->load(); $status = $this->serviceInstalled($service); $flag = strtolower(substr($serviceName,0,1)).substr($serviceName,1)."Installed"; if(!$status) {