Commit 4b210e4055e8d4b79f2ddbb9031913ecad67a17a
Merge branch 'edge' of git@github.com:ktgit/knowledgetree into edge
Showing
3 changed files
with
25 additions
and
8 deletions
setup/wizard/lib/helpers/config-path-mock
setup/wizard/steps/configuration.php
| ... | ... | @@ -457,7 +457,6 @@ class configuration extends Step |
| 457 | 457 | private function getPathInfo($fileSystemRoot) |
| 458 | 458 | { |
| 459 | 459 | if(isset($this->temp_variables['paths'])) { |
| 460 | - | |
| 461 | 460 | $dirs = $this->temp_variables['paths']; // Pull from temp |
| 462 | 461 | } else { |
| 463 | 462 | $this->readConfigPath(); |
| ... | ... | @@ -502,17 +501,28 @@ class configuration extends Step |
| 502 | 501 | private function getDirectories() |
| 503 | 502 | { |
| 504 | 503 | if(isset($this->confpaths['configIni'])) { |
| 505 | - $configPath = $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 | + } | |
| 506 | 512 | } else { |
| 507 | 513 | $configPath = '${fileSystemRoot}/config/config.ini'; |
| 508 | 514 | } |
| 515 | + if(isset($this->confpaths['var'])) { | |
| 516 | + $varPath = $this->confpaths['var']; | |
| 517 | + } else { | |
| 518 | + $varPath = '${fileSystemRoot}/var'; | |
| 519 | + } | |
| 509 | 520 | return array( |
| 510 | - array('name' => 'Var Directory', 'setting' => 'varDirectory', 'path' => '${fileSystemRoot}/var', 'create' => false), | |
| 521 | + array('name' => 'Var Directory', 'setting' => 'varDirectory', 'path' => $varPath, 'create' => false), | |
| 511 | 522 | array('name' => 'Document Directory', 'setting' => 'documentRoot', 'path' => '${varDirectory}/Documents', 'create' => true), |
| 512 | 523 | array('name' => 'Log Directory', 'setting' => 'logDirectory', 'path' => '${varDirectory}/log', 'create' => true), |
| 513 | 524 | array('name' => 'Temporary Directory', 'setting' => 'tmpDirectory', 'path' => '${varDirectory}/tmp', 'create' => true), |
| 514 | 525 | array('name' => 'Uploads Directory', 'setting' => 'uploadDirectory', 'path' => '${varDirectory}/uploads', 'create' => true), |
| 515 | - array('name' => 'Executables Directory', 'setting' => 'binDirectory', 'path' => '${varDirectory}/bin', 'create' => false), | |
| 516 | 526 | array('name' => 'Configuration File', 'setting' => 'configFile', 'path' => $configPath, 'create' => false), |
| 517 | 527 | ); |
| 518 | 528 | } |
| ... | ... | @@ -532,7 +542,6 @@ class configuration extends Step |
| 532 | 542 | array('name' => 'Log Directory', 'setting' => 'logDirectory', 'path' => $_POST['logDirectory'], 'create' => true), |
| 533 | 543 | array('name' => 'Temporary Directory', 'setting' => 'tmpDirectory', 'path' => $_POST['tmpDirectory'], 'create' => true), |
| 534 | 544 | array('name' => 'Uploads Directory', 'setting' => 'uploadDirectory', 'path' => $_POST['uploadDirectory'], 'create' => true), |
| 535 | - array('name' => 'Executables Directory', 'setting' => 'binDirectory', 'path' => $_POST['uploadDirectory'], 'create' => true), | |
| 536 | 545 | array('name' => 'Configuration File', 'setting' => 'configFile', 'path' => $_POST['configFile'], 'create' => false), |
| 537 | 546 | ); |
| 538 | 547 | } |
| ... | ... | @@ -587,10 +596,17 @@ class configuration extends Step |
| 587 | 596 | if(!$configPath) return false; |
| 588 | 597 | $ini = new Ini($configPath); |
| 589 | 598 | $data = $ini->getFileByLine(); |
| 599 | + $firstline = true; | |
| 590 | 600 | foreach ($data as $k=>$v) { |
| 591 | - if(preg_match('/config.ini/', $k)) { | |
| 601 | + if($firstline) { // First line holds the var directory | |
| 602 | + $firstline = false; | |
| 603 | + if(!preg_match('/config.ini/', $k)) { // Make sure it is not the old config.ini | |
| 604 | + $this->confpaths['var'] = $k; // Store var directory | |
| 605 | + } | |
| 606 | + } | |
| 607 | + if(preg_match('/config.ini/', $k)) { // Find config.ini | |
| 592 | 608 | $this->confpaths['configIni'] = $k; |
| 593 | - } elseif (preg_match('/Documents/', $k)) { | |
| 609 | + } elseif (preg_match('/Documents/', $k)) { // Find documents directory | |
| 594 | 610 | $this->confpaths['Documents'] = $k; |
| 595 | 611 | } elseif (preg_match('/cache/', $k)) { |
| 596 | 612 | $this->confpaths['cache'] = $k; | ... | ... |
setup/wizard/templates/complete.tpl
| ... | ... | @@ -87,7 +87,7 @@ |
| 87 | 87 | </tr> |
| 88 | 88 | <tr> |
| 89 | 89 | <td> <?php echo "<span class='{$SchedulerStatus}'> </span>"; ?> </td> |
| 90 | - <td> Scheduler Service <?php if ($LuceneStatus != 'tick') { ?> Could not be started <?php } else { ?> Started <?php } ?></td> | |
| 90 | + <td> Scheduler Service <?php if ($SchedulerStatus != 'tick') { ?> Could not be started <?php } else { ?> Started <?php } ?></td> | |
| 91 | 91 | <?php if ($SchedulerStatus != 'tick') { ?> |
| 92 | 92 | <td> |
| 93 | 93 | <?php if (AJAX) { ?> | ... | ... |