Commit 5903c15a8a4916da3ab226a4b6cf006269be12fe

Authored by Jarrett Jordaan
1 parent 3a97c8ad

Story Id:1166880 Server Testing Updates

Committed by: Jarrett Jordaan

Reviewed by: Megan Watson
setup/wizard/lib/validation/luceneValidation.php
@@ -367,7 +367,7 @@ class luceneValidation extends serviceValidation { @@ -367,7 +367,7 @@ class luceneValidation extends serviceValidation {
367 $javaExecutable = $this->util->javaSpecified();// Retrieve java bin 367 $javaExecutable = $this->util->javaSpecified();// Retrieve java bin
368 if($javaExecutable == '') { 368 if($javaExecutable == '') {
369 if($this->java == '') { 369 if($this->java == '') {
370 - return false; 370 + $this->java = 'java';
371 } 371 }
372 $javaExecutable = $this->java; 372 $javaExecutable = $this->java;
373 } 373 }
setup/wizard/steps/configuration.php
@@ -184,8 +184,8 @@ class configuration extends Step @@ -184,8 +184,8 @@ class configuration extends Step
184 $this->temp_variables = array("step_name"=>"configuration", "silent"=>$this->silent); 184 $this->temp_variables = array("step_name"=>"configuration", "silent"=>$this->silent);
185 $this->done = true; 185 $this->done = true;
186 if(!$this->inStep("configuration")) { 186 if(!$this->inStep("configuration")) {
187 - $this->setDetails();  
188 - $this->doRun(); 187 + $res = $this->setDetails();
  188 + $this->doRun($res);
189 return 'landing'; 189 return 'landing';
190 } 190 }
191 $this->loadTemplateDefaults(); 191 $this->loadTemplateDefaults();
@@ -197,14 +197,14 @@ class configuration extends Step @@ -197,14 +197,14 @@ class configuration extends Step
197 } else if($this->previous()) { 197 } else if($this->previous()) {
198 return 'previous'; 198 return 'previous';
199 } else if($this->confirm()) { 199 } else if($this->confirm()) {
200 - $this->setDetails();  
201 - if($this->doRun()) { 200 + $res = $this->setDetails();
  201 + if($this->doRun($res)) {
202 return 'next'; 202 return 'next';
203 } 203 }
204 return 'error'; 204 return 'error';
205 } else if($this->edit()) { 205 } else if($this->edit()) {
206 - $this->setDetails();  
207 - if($this->doRun(true)) { 206 + $res = $this->setDetails();
  207 + if($this->doRun($res)) {
208 return 'landing'; 208 return 'landing';
209 } else { 209 } else {
210 return 'error'; 210 return 'error';
@@ -229,6 +229,9 @@ class configuration extends Step @@ -229,6 +229,9 @@ class configuration extends Step
229 if($conf) { 229 if($conf) {
230 $this->temp_variables['server'] = $conf['server']; 230 $this->temp_variables['server'] = $conf['server'];
231 $this->temp_variables['paths'] = $conf['paths']; 231 $this->temp_variables['paths'] = $conf['paths'];
  232 + return true;
  233 + } else {
  234 + return false;
232 } 235 }
233 } 236 }
234 237
@@ -283,9 +286,6 @@ class configuration extends Step @@ -283,9 +286,6 @@ class configuration extends Step
283 } 286 }
284 287
285 private function registerDirs() { // Adjust directories variables 288 private function registerDirs() { // Adjust directories variables
286 -// $this->readConfigPath();  
287 -// $dirs = $this->getFromConfigPath();  
288 -// print_r($dirs);  
289 $directories['varDirectory'] = array('section'=>'urls', 'value'=>addslashes($this->allConfs['varDirectory']['path']), 'setting'=>'varDirectory'); 289 $directories['varDirectory'] = array('section'=>'urls', 'value'=>addslashes($this->allConfs['varDirectory']['path']), 'setting'=>'varDirectory');
290 $directories['logDirectory'] = array('section'=>'urls', 'value'=>addslashes($this->allConfs['logDirectory']['path']), 'setting'=>'logDirectory'); 290 $directories['logDirectory'] = array('section'=>'urls', 'value'=>addslashes($this->allConfs['logDirectory']['path']), 'setting'=>'logDirectory');
291 $directories['documentRoot'] = array('section'=>'urls', 'value'=>addslashes($this->allConfs['documentRoot']['path']), 'setting'=>'documentRoot'); 291 $directories['documentRoot'] = array('section'=>'urls', 'value'=>addslashes($this->allConfs['documentRoot']['path']), 'setting'=>'documentRoot');
@@ -311,23 +311,12 @@ class configuration extends Step @@ -311,23 +311,12 @@ class configuration extends Step
311 $server = $conf['server']; 311 $server = $conf['server'];
312 $paths = $conf['paths']; 312 $paths = $conf['paths'];
313 if ($this->util->isMigration()) { // Check if its an upgrade 313 if ($this->util->isMigration()) { // Check if its an upgrade
314 - $this->confpaths['configIni'] = $this->readConfigPathIni();  
315 $this->readInstallation(); 314 $this->readInstallation();
316 - $configPath = $this->confpaths['configIni'];  
317 } else { 315 } else {
318 $this->readConfigPath(); // initialise writing to config.ini 316 $this->readConfigPath(); // initialise writing to config.ini
319 - if(isset($this->confpaths['configIni'])) { // Check if theres a config path  
320 - $configPath = realpath("../../{$this->confpaths['configIni']}"); // Relative to Config Path File  
321 - if($configPath == '') { // Absolute path probably entered  
322 - $configPath = realpath("{$this->confpaths['configIni']}"); // Get relative path  
323 - }  
324 - } else {  
325 - $configPath = realpath('../../config/config.ini'); // Normal  
326 - }  
327 } 317 }
328 $this->getFromConfigPath(); 318 $this->getFromConfigPath();
329 $ini = false; 319 $ini = false;
330 -// print_r($configPath);  
331 if(file_exists($configPath)) { 320 if(file_exists($configPath)) {
332 $ini = new iniUtilities($configPath); 321 $ini = new iniUtilities($configPath);
333 } 322 }
@@ -452,7 +441,6 @@ class configuration extends Step @@ -452,7 +441,6 @@ class configuration extends Step
452 { 441 {
453 if(isset($this->temp_variables['paths'])) { 442 if(isset($this->temp_variables['paths'])) {
454 if ($this->util->isMigration()) { // Check if its an upgrade 443 if ($this->util->isMigration()) { // Check if its an upgrade
455 - $this->confpaths['configIni'] = $this->readConfigPathIni();  
456 $this->readInstallation(); // Read values from config.ini of other installation 444 $this->readInstallation(); // Read values from config.ini of other installation
457 $dirs = $this->getFromConfigPath(); // Store contents 445 $dirs = $this->getFromConfigPath(); // Store contents
458 } else { 446 } else {
@@ -460,7 +448,6 @@ class configuration extends Step @@ -460,7 +448,6 @@ class configuration extends Step
460 } 448 }
461 } else { 449 } else {
462 if ($this->util->isMigration()) { // Check if its an upgrade 450 if ($this->util->isMigration()) { // Check if its an upgrade
463 - $this->confpaths['configIni'] = $this->readConfigPathIni();  
464 $this->readInstallation(); // Read values from config.ini of other installation 451 $this->readInstallation(); // Read values from config.ini of other installation
465 } else { 452 } else {
466 $this->readConfigPath(); // Read contents of config-path file 453 $this->readConfigPath(); // Read contents of config-path file
@@ -495,48 +482,6 @@ class configuration extends Step @@ -495,48 +482,6 @@ class configuration extends Step
495 482
496 return $dirs; 483 return $dirs;
497 } 484 }
498 -  
499 -  
500 -  
501 - /**  
502 - * Get the list of directories that need to be checked  
503 - *  
504 - * @author KnowledgeTree Team  
505 - * @access private  
506 - * @return array The directory list  
507 - */  
508 - private function getDirectories()  
509 - {  
510 - return array(  
511 - array('name' => 'Var Directory', 'setting' => 'varDirectory', 'path' => '${varDirectory}', 'create' => false),  
512 - array('name' => 'Document Directory', 'setting' => 'documentRoot', 'path' => '${varDirectory}/Documents', 'create' => true),  
513 - array('name' => 'Log Directory', 'setting' => 'logDirectory', 'path' => '${varDirectory}/log', 'create' => true),  
514 - array('name' => 'Temporary Directory', 'setting' => 'tmpDirectory', 'path' => '${varDirectory}/tmp', 'create' => true),  
515 - array('name' => 'Cache Directory', 'setting' => 'cacheDirectory', 'path' => '${varDirectory}/cache', 'create' => true),  
516 - array('name' => 'Uploads Directory', 'setting' => 'uploadDirectory', 'path' => '${varDirectory}/uploads', 'create' => true),  
517 - array('name' => 'Configuration File', 'setting' => 'configFile', 'path' => '${fileSystemRoot}/config/config.ini', 'create' => false),  
518 - );  
519 - }  
520 -  
521 - /**  
522 - * Store contents of edited settings  
523 - *  
524 - * @author KnowledgeTree Team  
525 - * @access private  
526 - * @param none  
527 - * @return array The path information  
528 - */  
529 - private function setFromPost() {  
530 - $this->paths = array(  
531 - array('name' => 'Var Directory', 'setting' => 'varDirectory', 'path' => $_POST['varDirectory'], 'create' => false),  
532 - array('name' => 'Document Directory', 'setting' => 'documentRoot', 'path' => $_POST['documentRoot'], 'create' => true),  
533 - array('name' => 'Log Directory', 'setting' => 'logDirectory', 'path' => $_POST['logDirectory'], 'create' => true),  
534 - array('name' => 'Temporary Directory', 'setting' => 'tmpDirectory', 'path' => $_POST['tmpDirectory'], 'create' => true),  
535 - array('name' => 'Cache Directory', 'setting' => 'cacheDirectory', 'path' => $_POST['cacheDirectory'], 'create' => true),  
536 - array('name' => 'Uploads Directory', 'setting' => 'uploadDirectory', 'path' => $_POST['uploadDirectory'], 'create' => true),  
537 - array('name' => 'Configuration File', 'setting' => 'configFile', 'path' => $_POST['configFile'], 'create' => false, 'file'=>true),  
538 - );  
539 - }  
540 485
541 /** 486 /**
542 * Store contents of edited settings 487 * Store contents of edited settings
@@ -551,7 +496,7 @@ class configuration extends Step @@ -551,7 +496,7 @@ class configuration extends Step
551 if(isset($this->confpaths['configIni'])) { // Simple check to see if any paths were written 496 if(isset($this->confpaths['configIni'])) { // Simple check to see if any paths were written
552 $configPath = $this->confpaths['configIni']; // Get absolute path 497 $configPath = $this->confpaths['configIni']; // Get absolute path
553 } else { 498 } else {
554 - $configPath = '${fileSystemRoot}/config/config.ini'; 499 + $configPath = $this->readConfigPathIni(); //'${fileSystemRoot}/config/config.ini';
555 } 500 }
556 $configs['configFile'] = array('name' => 'Configuration File', 'setting' => 'configFile', 'path' => $configPath, 'create' => false, 'file'=>true); 501 $configs['configFile'] = array('name' => 'Configuration File', 'setting' => 'configFile', 'path' => $configPath, 'create' => false, 'file'=>true);
557 if(isset($this->confpaths['Documents'])) { 502 if(isset($this->confpaths['Documents'])) {
@@ -596,18 +541,6 @@ class configuration extends Step @@ -596,18 +541,6 @@ class configuration extends Step
596 } 541 }
597 542
598 /** 543 /**
599 - * Path information  
600 - *  
601 - * @author KnowledgeTree Team  
602 - * @access public  
603 - * @param string $fileSystemRoot The file system root of the installation  
604 - * @return array The path information  
605 - */  
606 - public function getFromPost() {  
607 - return $this->paths;  
608 - }  
609 -  
610 - /**  
611 * Migration Path finder 544 * Migration Path finder
612 * 545 *
613 * @author KnowledgeTree Team 546 * @author KnowledgeTree Team
@@ -638,10 +571,16 @@ class configuration extends Step @@ -638,10 +571,16 @@ class configuration extends Step
638 } 571 }
639 } 572 }
640 573
  574 + // Now for config path itself
  575 + if(isset($this->temp_variables['']))
  576 +
641 return true; 577 return true;
642 } 578 }
643 579
644 private function readConfigPathIni() { 580 private function readConfigPathIni() {
  581 + if(isset($this->temp_variables['paths']['configFile']['path'])) {
  582 + return $this->temp_variables['paths']['configFile']['path'];
  583 + }
645 $configPath = $this->getContentPath(); 584 $configPath = $this->getContentPath();
646 if(!$configPath) return false; 585 if(!$configPath) return false;
647 $ini = new iniUtilities($configPath); 586 $ini = new iniUtilities($configPath);