diff --git a/setup/migrate/config/config.xml b/setup/migrate/config/config.xml index 7e1c62a..d394269 100644 --- a/setup/migrate/config/config.xml +++ b/setup/migrate/config/config.xml @@ -7,7 +7,7 @@ Description: Migrateer steps --> - + installation services diff --git a/setup/upgrade/config/config.xml b/setup/upgrade/config/config.xml index aa11286..7acf4a2 100644 --- a/setup/upgrade/config/config.xml +++ b/setup/upgrade/config/config.xml @@ -7,7 +7,7 @@ Description: Upgrader steps --> - + welcome installation diff --git a/setup/wizard/lib/system/config-path-mock b/setup/wizard/lib/system/config-path-mock index 169cb02..8fb204f 100644 --- a/setup/wizard/lib/system/config-path-mock +++ b/setup/wizard/lib/system/config-path-mock @@ -1,7 +1,7 @@ /var/lib/knowledgetree-ce /var/lib/knowledgetree-ce/Documents /var/lib/knowledgetree-ce/indexes -/etc/knowledgetree/config.ini +/etc/knowledgetree-ce/config.ini /var/log/knowledgetree-ce /var/tmp/knowledgetree-ce /var/tmp/knowledgetree-ce/proxies diff --git a/setup/wizard/lib/validation/luceneValidation.php b/setup/wizard/lib/validation/luceneValidation.php index b35c72d..5d28589 100644 --- a/setup/wizard/lib/validation/luceneValidation.php +++ b/setup/wizard/lib/validation/luceneValidation.php @@ -274,7 +274,7 @@ class luceneValidation extends serviceValidation { if($auto) { return $auto; } else { - $auto = $this->useDetected(); // Check if auto detected java works + $auto = $this->detSettings(); // Check if auto detected java works if($auto) { $this->disableExtension = true; // Disable the use of the php bridge extension return $auto; @@ -454,18 +454,6 @@ class luceneValidation extends serviceValidation { } } - /** - * Attempt detection without logging errors - * - * @author KnowledgeTree Team - * @param none - * @access private - * @return boolean - */ - private function useDetected() { - return $this->detSettings(); - } - /** * Set all silent mode varibles * diff --git a/setup/wizard/steps/configuration.php b/setup/wizard/steps/configuration.php index 50c7142..7786742 100644 --- a/setup/wizard/steps/configuration.php +++ b/setup/wizard/steps/configuration.php @@ -53,6 +53,7 @@ if(isset($_GET['action'])) { class configuration extends Step { + private $allConfs; /** * Database host * @@ -282,16 +283,19 @@ class configuration extends Step } private function registerDirs() { // Adjust directories variables - $this->readConfigPath(); - $dirs = $this->getFromConfigPath(); - $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'); +// $this->readConfigPath(); +// $dirs = $this->getFromConfigPath(); +// print_r($dirs); + $directories['varDirectory'] = array('section'=>'urls', 'value'=>addslashes($this->allConfs['varDirectory']['path']), 'setting'=>'varDirectory'); + $directories['logDirectory'] = array('section'=>'urls', 'value'=>addslashes($this->allConfs['logDirectory']['path']), 'setting'=>'logDirectory'); + $directories['documentRoot'] = array('section'=>'urls', 'value'=>addslashes($this->allConfs['documentRoot']['path']), 'setting'=>'documentRoot'); $directories['uiDirectory'] = array('section'=>'urls', 'value'=>'${fileSystemRoot}/presentation/lookAndFeel/knowledgeTree', 'setting'=>'uiDirectory'); - $directories['tmpDirectory'] = array('section'=>'urls', 'value'=>addslashes($dirs['tmpDirectory']['path']), 'setting'=>'tmpDirectory'); + $directories['tmpDirectory'] = array('section'=>'urls', 'value'=>addslashes($this->allConfs['tmpDirectory']['path']), 'setting'=>'tmpDirectory'); + $directories['cacheDirectory'] = array('section'=>'cache', 'value'=>addslashes($this->allConfs['cacheDirectory']['path']), 'setting'=>'cacheDirectory'); return $directories; } + /** * Perform the installation associated with the step. * Variables required by the installation are stored within the session. @@ -306,22 +310,24 @@ class configuration extends Step $this->dbhandler->load($dbconf['dhost'], $dbconf['dmsname'], $dbconf['dmspassword'], $dbconf['dname']); $server = $conf['server']; $paths = $conf['paths']; - // TODO if ($this->util->isMigration()) { // Check if its an upgrade + $this->confpaths['configIni'] = $this->readConfigPathIni(); $this->readInstallation(); + $configPath = $this->confpaths['configIni']; } else { $this->readConfigPath(); // initialise writing to config.ini + if(isset($this->confpaths['configIni'])) { // Check if theres a config path + $configPath = realpath("../../{$this->confpaths['configIni']}"); // Relative to Config Path File + if($configPath == '') { // Absolute path probably entered + $configPath = realpath("{$this->confpaths['configIni']}"); // Get relative path + } + } else { + $configPath = realpath('../../config/config.ini'); // Normal + } } - $dirs = $this->getFromConfigPath(); - if(isset($this->confpaths['configIni'])) { // Check if theres a config path - $configPath = realpath("../../{$this->confpaths['configIni']}"); // Relative to Config Path File - if($configPath == '') { // Absolute path probably entered - $configPath = realpath("{$this->confpaths['configIni']}"); // Get relative path - } - } else { - $configPath = realpath('../../config/config.ini'); - } + $this->getFromConfigPath(); $ini = false; +// print_r($configPath); if(file_exists($configPath)) { $ini = new iniUtilities($configPath); } @@ -333,7 +339,7 @@ class configuration extends Step } $this->dbhandler->close(); // close the database connection $this->writeCachePath(); // Write cache path file - $this->writeConfigPath(); // Write config file + $this->writeConfigPath($configPath); // Write config file } private function writeUrlSection($ini) { @@ -446,6 +452,7 @@ class configuration extends Step { if(isset($this->temp_variables['paths'])) { if ($this->util->isMigration()) { // Check if its an upgrade + $this->confpaths['configIni'] = $this->readConfigPathIni(); $this->readInstallation(); // Read values from config.ini of other installation $dirs = $this->getFromConfigPath(); // Store contents } else { @@ -453,6 +460,7 @@ class configuration extends Step } } else { if ($this->util->isMigration()) { // Check if its an upgrade + $this->confpaths['configIni'] = $this->readConfigPathIni(); $this->readInstallation(); // Read values from config.ini of other installation } else { $this->readConfigPath(); // Read contents of config-path file @@ -583,6 +591,7 @@ class configuration extends Step } $configs['varDirectory'] = array('name' => 'Var Directory', 'setting' => 'varDirectory', 'path' => $varPath, 'create' => false); + $this->allConfs = $configs; return $configs; } @@ -632,6 +641,21 @@ class configuration extends Step return true; } + private function readConfigPathIni() { + $configPath = $this->getContentPath(); + if(!$configPath) return false; + $ini = new iniUtilities($configPath); + $data = $ini->getFileByLine(); + $firstline = true; + foreach ($data as $k=>$v) { + if(preg_match('/config.ini/', $k)) { // Find config.ini + return $k; + } + } + + return false; + } + /** * Read contents of config path file * @@ -676,14 +700,14 @@ class configuration extends Step } /** - * Read contents of config path file + * Write location of config path file * * @author KnowledgeTree Team * @access private * @param none * @return boolean */ - private function writeConfigPath() { + private function writeConfigPath($configPath = '') { $configPath = $this->getContentPath(); if(!$configPath) return false; $ini = new iniUtilities($configPath); @@ -746,10 +770,6 @@ class configuration extends Step if(!$cachePath) return false; return $cachePath; } - - public function doReadConfig() { - - } } if(isset($_GET['action'])) {