Commit e3a4474f6140734195072f5b60cb489c08ab1181
1 parent
16f67c3d
Story Id:1166880 Daily Commit
Committed by: Jarrett Jordaan Reviewed by: Paul Barrett
Showing
6 changed files
with
86 additions
and
40 deletions
setup/wizard/lib/helpers/config-path-mock
| 1 | -/var/www/installers/knowledgetree/var_test/ | |
| 1 | +/var/lib/knowledgetree | |
| 2 | 2 | /var/www/installers/knowledgetree/config/config.ini |
| 3 | -/var/www/installers/knowledgetree/var_test/cache | |
| 4 | -/var/www/installers/knowledgetree/var_test/Documents | |
| 5 | -/var/www/installers/knowledgetree/var_test/indexes | |
| 6 | -/var/www/installers/knowledgetree/var_test/log | |
| 7 | -/var/www/installers/knowledgetree/var_test/Pdf | |
| 8 | -/var/www/installers/knowledgetree/var_test/proxies | |
| 9 | -/var/www/installers/knowledgetree/var_test/tmp | |
| 10 | -/var/www/installers/knowledgetree/var_test/uploads | |
| 11 | 3 | \ No newline at end of file |
| 4 | +/var/log/knowledgetree | |
| 5 | +/var/tmp/knowledgetree | |
| 6 | +/var/lib/knowledgetree/Documents | |
| 7 | +/var/lib/knowledgetree/indexes | |
| 8 | +/var/lib/knowledgetree/proxies | |
| 9 | +/var/lib/knowledgetree/uploads | |
| 12 | 10 | \ No newline at end of file | ... | ... |
setup/wizard/lib/helpers/systemCheck.php
0 → 100644
| 1 | +<?php | |
| 2 | + include("../../path.php"); | |
| 3 | + | |
| 4 | + if(is_writable(SYS_VAR_DIR.DS."log")) { | |
| 5 | + echo 'var/log is writable<br>'; | |
| 6 | + } | |
| 7 | + if(is_writable(SYS_VAR_DIR.DS."bin")) { | |
| 8 | + echo 'var/bin is writable<br>'; | |
| 9 | + } | |
| 10 | + if(is_writable(SYS_VAR_DIR.DS."tmp")) { | |
| 11 | + echo 'var/tmp is writable<br>'; | |
| 12 | + } | |
| 13 | + if(is_writable(SYS_VAR_DIR.DS."Documents")) { | |
| 14 | + echo 'var/Documents is writable<br>'; | |
| 15 | + } | |
| 16 | + | |
| 17 | +?> | |
| 0 | 18 | \ No newline at end of file | ... | ... |
setup/wizard/lib/services/unixLucene.php
| ... | ... | @@ -58,6 +58,7 @@ class unixLucene extends unixService { |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | public function load() { |
| 61 | + $this->setSystemOutputDir(); | |
| 61 | 62 | $this->setLuceneDir(SYSTEM_DIR."bin".DS."luceneserver".DS); |
| 62 | 63 | $this->setIndexerDir(SYSTEM_DIR."search2".DS."indexing".DS."bin".DS); |
| 63 | 64 | $this->setLucenePidFile("lucene_test.pid"); |
| ... | ... | @@ -67,6 +68,13 @@ class unixLucene extends unixService { |
| 67 | 68 | $this->setShutdownScript("shutdown.php"); |
| 68 | 69 | } |
| 69 | 70 | |
| 71 | + function setSystemOutputDir() { | |
| 72 | + $conf = $this->util->getDataFromSession('configuration'); | |
| 73 | + print_r($conf); | |
| 74 | + die; | |
| 75 | +// $conf['path']['']; | |
| 76 | + } | |
| 77 | + | |
| 70 | 78 | public function setIndexerDir($indexerDir) { |
| 71 | 79 | $this->indexerDir = $indexerDir; |
| 72 | 80 | } | ... | ... |
setup/wizard/lib/services/unixOpenOffice.php
setup/wizard/lib/services/windowsLucene.php
| ... | ... | @@ -140,6 +140,7 @@ class windowsLucene extends windowsService { |
| 140 | 140 | * @return void |
| 141 | 141 | */ |
| 142 | 142 | public function load() { |
| 143 | + $this->setSystemOutputDir(); | |
| 143 | 144 | $this->setJavaBin(); |
| 144 | 145 | $this->setLuceneDIR(SYSTEM_DIR."bin".DS."luceneserver"); |
| 145 | 146 | $this->setLuceneExe("KTLuceneService.exe"); |
| ... | ... | @@ -150,6 +151,13 @@ class windowsLucene extends windowsService { |
| 150 | 151 | $this->setLuceneError("lucene-err.txt"); |
| 151 | 152 | } |
| 152 | 153 | |
| 154 | + function setSystemOutputDir() { | |
| 155 | + $conf = $this->util->getDataFromSession('configuration'); | |
| 156 | + print_r($conf); | |
| 157 | + die; | |
| 158 | +// $conf['path']['']; | |
| 159 | + } | |
| 160 | + | |
| 153 | 161 | /** |
| 154 | 162 | * Retrieve Status Service |
| 155 | 163 | * | ... | ... |
setup/wizard/steps/configuration.php
| ... | ... | @@ -500,30 +500,13 @@ class configuration extends Step |
| 500 | 500 | */ |
| 501 | 501 | private function getDirectories() |
| 502 | 502 | { |
| 503 | - if(isset($this->confpaths['configIni'])) { | |
| 504 | - if(isset($this->confpaths['configIni'])) { // Check if theres a config path | |
| 505 | - $configPath = realpath("../../{$this->confpaths['configIni']}"); // Relative to Config Path File | |
| 506 | - if($configPath == '') { // Absolute path probably entered | |
| 507 | - $configPath = realpath("{$this->confpaths['configIni']}"); // Get relative path | |
| 508 | - } | |
| 509 | - } else { | |
| 510 | - $configPath = realpath('../../config/config.ini'); | |
| 511 | - } | |
| 512 | - } else { | |
| 513 | - $configPath = '${fileSystemRoot}/config/config.ini'; | |
| 514 | - } | |
| 515 | - if(isset($this->confpaths['var'])) { | |
| 516 | - $varPath = $this->confpaths['var']; | |
| 517 | - } else { | |
| 518 | - $varPath = '${fileSystemRoot}/var'; | |
| 519 | - } | |
| 520 | 503 | return array( |
| 521 | - array('name' => 'Var Directory', 'setting' => 'varDirectory', 'path' => $varPath, 'create' => false), | |
| 504 | + array('name' => 'Var Directory', 'setting' => 'varDirectory', 'path' => '${varDirectory}', 'create' => false), | |
| 522 | 505 | array('name' => 'Document Directory', 'setting' => 'documentRoot', 'path' => '${varDirectory}/Documents', 'create' => true), |
| 523 | 506 | array('name' => 'Log Directory', 'setting' => 'logDirectory', 'path' => '${varDirectory}/log', 'create' => true), |
| 524 | 507 | array('name' => 'Temporary Directory', 'setting' => 'tmpDirectory', 'path' => '${varDirectory}/tmp', 'create' => true), |
| 525 | 508 | array('name' => 'Uploads Directory', 'setting' => 'uploadDirectory', 'path' => '${varDirectory}/uploads', 'create' => true), |
| 526 | - array('name' => 'Configuration File', 'setting' => 'configFile', 'path' => $configPath, 'create' => false), | |
| 509 | + array('name' => 'Configuration File', 'setting' => 'configFile', 'path' => '${fileSystemRoot}/config/config.ini', 'create' => false), | |
| 527 | 510 | ); |
| 528 | 511 | } |
| 529 | 512 | |
| ... | ... | @@ -555,20 +538,51 @@ class configuration extends Step |
| 555 | 538 | * @return array The path information |
| 556 | 539 | */ |
| 557 | 540 | private function getFromConfigPath() { |
| 558 | - if(isset($this->confpaths['Documents'])) { // Simple check to see if any paths were written | |
| 559 | - return array ( | |
| 560 | - array('name' => 'Configuration File', 'setting' => 'configFile', 'path' => $this->confpaths['configIni'], 'create' => false), | |
| 561 | - array('name' => 'Document Directory', 'setting' => 'documentRoot', 'path' => $this->confpaths['Documents'], 'create' => true), | |
| 562 | - array('name' => 'Cache Directory', 'setting' => 'cacheDirectory', 'path' => $this->confpaths['cache'], 'create' => true), | |
| 563 | - array('name' => 'Index Directory', 'setting' => 'indexDirectory', 'path' => $this->confpaths['indexes'], 'create' => true), | |
| 564 | - array('name' => 'Log Directory', 'setting' => 'logDirectory', 'path' => $this->confpaths['log'], 'create' => true), | |
| 565 | - array('name' => 'Proxy Directory', 'setting' => 'proxiesDirectory', 'path' => $this->confpaths['proxies'], 'create' => true), | |
| 566 | - array('name' => 'Temporary Directory', 'setting' => 'tmpDirectory', 'path' => $this->confpaths['tmp'], 'create' => true), | |
| 567 | - array('name' => 'Uploads Directory', 'setting' => 'uploadDirectory', 'path' => $this->confpaths['uploads'], 'create' => true), | |
| 568 | - ); | |
| 541 | + $configs = array(); | |
| 542 | + if(isset($this->confpaths['configIni'])) { // Simple check to see if any paths were written | |
| 543 | + $configPath = realpath("../../{$this->confpaths['configIni']}"); // Relative to Config Path File | |
| 544 | + if($configPath == '') { // Absolute path probably entered | |
| 545 | + $configPath = realpath("{$this->confpaths['configIni']}"); // Get absolute path | |
| 546 | + if($configPath == '') { | |
| 547 | + $configPath = realpath('../../config/config.ini'); | |
| 548 | + } | |
| 549 | + } | |
| 550 | + } else { | |
| 551 | + $configPath = '${fileSystemRoot}/config/config.ini'; | |
| 552 | + } | |
| 553 | + $configs['configFile'] = array('name' => 'Configuration File', 'setting' => 'configFile', 'path' => $configPath, 'create' => false); | |
| 554 | + if(isset($this->confpaths['Documents'])) { | |
| 555 | + $docsPath = $this->confpaths['Documents']; | |
| 556 | + } else { | |
| 557 | + $docsPath = '${varDirectory}/Documents'; | |
| 558 | + } | |
| 559 | + $configs['documentRoot'] = array('name' => 'Document Directory', 'setting' => 'documentRoot', 'path' => $docsPath, 'create' => true); | |
| 560 | + if(isset($this->confpaths['log'])) { | |
| 561 | + $logPath = $this->confpaths['log']; | |
| 569 | 562 | } else { |
| 570 | - return $this->getDirectories(); | |
| 563 | + $logPath = '${varDirectory}/log'; | |
| 564 | + } | |
| 565 | + $configs['logDirectory'] = array('name' => 'Log Directory', 'setting' => 'logDirectory', 'path' => $logPath, 'create' => true); | |
| 566 | + if(isset($this->confpaths['tmp'])) { | |
| 567 | + $tmpPath = $this->confpaths['tmp']; | |
| 568 | + } else { | |
| 569 | + $tmpPath = '${varDirectory}/tmp'; | |
| 570 | + } | |
| 571 | + $configs['tmpDirectory'] = array('name' => 'Temporary Directory', 'setting' => 'tmpDirectory', 'path' => $tmpPath, 'create' => true); | |
| 572 | + if(isset($this->confpaths['uploads'])) { | |
| 573 | + $uploadsPath = $this->confpaths['uploads']; | |
| 574 | + } else { | |
| 575 | + $uploadsPath = '${varDirectory}/uploads'; | |
| 576 | + } | |
| 577 | + $configs['uploadDirectory'] = array('name' => 'Uploads Directory', 'setting' => 'uploadDirectory', 'path' => $uploadsPath, 'create' => true); | |
| 578 | + if(isset($this->confpaths['var'])) { | |
| 579 | + $varPath = $this->confpaths['var']; | |
| 580 | + } else { | |
| 581 | + $varPath = '${fileSystemRoot}/var'; | |
| 571 | 582 | } |
| 583 | + $configs['varDirectory'] = array('name' => 'Var Directory', 'setting' => 'varDirectory', 'path' => $varPath, 'create' => false); | |
| 584 | + | |
| 585 | + return $configs; | |
| 572 | 586 | } |
| 573 | 587 | |
| 574 | 588 | /** | ... | ... |