Commit 45b7d19a48c0f0da17648a94a717c71b56166d7a
Merge branch 'edge' of git@github.com:ktgit/knowledgetree into edge
Showing
1 changed file
with
18 additions
and
3 deletions
setup/wizard/steps/configuration.php
| @@ -321,8 +321,16 @@ class configuration extends Step | @@ -321,8 +321,16 @@ class configuration extends Step | ||
| 321 | $paths = $conf['paths']; | 321 | $paths = $conf['paths']; |
| 322 | 322 | ||
| 323 | // initialise writing to config.ini | 323 | // initialise writing to config.ini |
| 324 | - $configPath = realpath('../../config/config.ini'); | ||
| 325 | - | 324 | + $this->readConfigPath(); |
| 325 | + $dirs = $this->getFromConfigPath(); | ||
| 326 | + if(isset($this->confpaths['configIni'])) { // Check if theres a config path | ||
| 327 | + $configPath = realpath("../../{$this->confpaths['configIni']}"); // Relative to Config Path File | ||
| 328 | + if($configPath == '') { // Absolute path probably entered | ||
| 329 | + $configPath = realpath("{$this->confpaths['configIni']}"); // Get relative path | ||
| 330 | + } | ||
| 331 | + } else { | ||
| 332 | + $configPath = realpath('../../config/config.ini'); | ||
| 333 | + } | ||
| 326 | $ini = false; | 334 | $ini = false; |
| 327 | if(file_exists($configPath)) { | 335 | if(file_exists($configPath)) { |
| 328 | $ini = new Ini($configPath); | 336 | $ini = new Ini($configPath); |
| @@ -449,10 +457,12 @@ class configuration extends Step | @@ -449,10 +457,12 @@ class configuration extends Step | ||
| 449 | private function getPathInfo($fileSystemRoot) | 457 | private function getPathInfo($fileSystemRoot) |
| 450 | { | 458 | { |
| 451 | if(isset($this->temp_variables['paths'])) { | 459 | if(isset($this->temp_variables['paths'])) { |
| 460 | + | ||
| 452 | $dirs = $this->temp_variables['paths']; // Pull from temp | 461 | $dirs = $this->temp_variables['paths']; // Pull from temp |
| 453 | } else { | 462 | } else { |
| 454 | $this->readConfigPath(); | 463 | $this->readConfigPath(); |
| 455 | $dirs = $this->getFromConfigPath(); | 464 | $dirs = $this->getFromConfigPath(); |
| 465 | + | ||
| 456 | } | 466 | } |
| 457 | $varDirectory = $fileSystemRoot . DS . 'var'; | 467 | $varDirectory = $fileSystemRoot . DS . 'var'; |
| 458 | foreach ($dirs as $key => $dir){ | 468 | foreach ($dirs as $key => $dir){ |
| @@ -491,6 +501,11 @@ class configuration extends Step | @@ -491,6 +501,11 @@ class configuration extends Step | ||
| 491 | */ | 501 | */ |
| 492 | private function getDirectories() | 502 | private function getDirectories() |
| 493 | { | 503 | { |
| 504 | + if(isset($this->confpaths['configIni'])) { | ||
| 505 | + $configPath = $this->confpaths['configIni']; | ||
| 506 | + } else { | ||
| 507 | + $configPath = '${fileSystemRoot}/config/config.ini'; | ||
| 508 | + } | ||
| 494 | return array( | 509 | return array( |
| 495 | array('name' => 'Var Directory', 'setting' => 'varDirectory', 'path' => '${fileSystemRoot}/var', 'create' => false), | 510 | array('name' => 'Var Directory', 'setting' => 'varDirectory', 'path' => '${fileSystemRoot}/var', 'create' => false), |
| 496 | array('name' => 'Document Directory', 'setting' => 'documentRoot', 'path' => '${varDirectory}/Documents', 'create' => true), | 511 | array('name' => 'Document Directory', 'setting' => 'documentRoot', 'path' => '${varDirectory}/Documents', 'create' => true), |
| @@ -498,7 +513,7 @@ class configuration extends Step | @@ -498,7 +513,7 @@ class configuration extends Step | ||
| 498 | array('name' => 'Temporary Directory', 'setting' => 'tmpDirectory', 'path' => '${varDirectory}/tmp', 'create' => true), | 513 | array('name' => 'Temporary Directory', 'setting' => 'tmpDirectory', 'path' => '${varDirectory}/tmp', 'create' => true), |
| 499 | array('name' => 'Uploads Directory', 'setting' => 'uploadDirectory', 'path' => '${varDirectory}/uploads', 'create' => true), | 514 | array('name' => 'Uploads Directory', 'setting' => 'uploadDirectory', 'path' => '${varDirectory}/uploads', 'create' => true), |
| 500 | array('name' => 'Executables Directory', 'setting' => 'binDirectory', 'path' => '${varDirectory}/bin', 'create' => false), | 515 | array('name' => 'Executables Directory', 'setting' => 'binDirectory', 'path' => '${varDirectory}/bin', 'create' => false), |
| 501 | - array('name' => 'Configuration File', 'setting' => 'configFile', 'path' => '${fileSystemRoot}/config/config.ini', 'create' => false), | 516 | + array('name' => 'Configuration File', 'setting' => 'configFile', 'path' => $configPath, 'create' => false), |
| 502 | ); | 517 | ); |
| 503 | } | 518 | } |
| 504 | 519 |