Commit 301068dfff23fc446ebc8f4c4a5805f616b3164f

Authored by Jarrett Jordaan
1 parent 31d09f1d

KTS4498-Updated windows paths

Committed by: Jarrett Jordaan

Reviewed by: Prince Mbekwa
setup/wizard/installUtil.php
@@ -776,6 +776,11 @@ class InstallUtil { @@ -776,6 +776,11 @@ class InstallUtil {
776 $jvm = $zendsys."jre".DS."bin".DS."client".DS."jvm.dll"; 776 $jvm = $zendsys."jre".DS."bin".DS."client".DS."jvm.dll";
777 if(file_exists($jvm)) 777 if(file_exists($jvm))
778 return $jvm; 778 return $jvm;
  779 + } else {
  780 + $java = "/usr/bin/java";
  781 + if(file_exists($java)) {
  782 + return $java;
  783 + }
779 } 784 }
780 } 785 }
781 786
setup/wizard/lib/validation/luceneValidation.php
@@ -49,7 +49,7 @@ class luceneValidation extends serviceValidation { @@ -49,7 +49,7 @@ class luceneValidation extends serviceValidation {
49 * @var string 49 * @var string
50 */ 50 */
51 private $java = ""; 51 private $java = "";
52 - 52 +
53 /** 53 /**
54 * Minumum Java Version 54 * Minumum Java Version
55 * 55 *
@@ -67,7 +67,7 @@ class luceneValidation extends serviceValidation { @@ -67,7 +67,7 @@ class luceneValidation extends serviceValidation {
67 * @var mixed 67 * @var mixed
68 */ 68 */
69 private $providedJava = false; 69 private $providedJava = false;
70 - 70 +
71 /** 71 /**
72 * Flag, if java is specified and an error has been encountered 72 * Flag, if java is specified and an error has been encountered
73 * 73 *
@@ -76,7 +76,7 @@ class luceneValidation extends serviceValidation { @@ -76,7 +76,7 @@ class luceneValidation extends serviceValidation {
76 * @var booelean 76 * @var booelean
77 */ 77 */
78 private $javaExeError = false; 78 private $javaExeError = false;
79 - 79 +
80 /** 80 /**
81 * Holds path error, if java is specified 81 * Holds path error, if java is specified
82 * 82 *
@@ -85,16 +85,16 @@ class luceneValidation extends serviceValidation { @@ -85,16 +85,16 @@ class luceneValidation extends serviceValidation {
85 * @var string 85 * @var string
86 */ 86 */
87 private $javaExeMessage = ''; 87 private $javaExeMessage = '';
88 - 88 +
89 /** 89 /**
90 - * Java Installed 90 + * Java Installed
91 * 91 *
92 * @author KnowledgeTree Team 92 * @author KnowledgeTree Team
93 * @access private 93 * @access private
94 * @var mixed 94 * @var mixed
95 */ 95 */
96 private $javaCheck = 'cross'; 96 private $javaCheck = 'cross';
97 - 97 +
98 /** 98 /**
99 * Flag if bridge extension needs to be disabled 99 * Flag if bridge extension needs to be disabled
100 * 100 *
@@ -105,14 +105,14 @@ class luceneValidation extends serviceValidation { @@ -105,14 +105,14 @@ class luceneValidation extends serviceValidation {
105 private $disableExtension = false; 105 private $disableExtension = false;
106 106
107 /** 107 /**
108 - * Java Bridge Installed 108 + * Java Bridge Installed
109 * 109 *
110 * @author KnowledgeTree Team 110 * @author KnowledgeTree Team
111 * @access private 111 * @access private
112 * @var mixed 112 * @var mixed
113 */ 113 */
114 private $javaExtCheck = 'cross_orange'; 114 private $javaExtCheck = 'cross_orange';
115 - 115 +
116 public function preset() { 116 public function preset() {
117 /* Rely on Script */ 117 /* Rely on Script */
118 $this->zendBridgeInstalled(); 118 $this->zendBridgeInstalled();
@@ -124,7 +124,7 @@ class luceneValidation extends serviceValidation { @@ -124,7 +124,7 @@ class luceneValidation extends serviceValidation {
124 // $this->javaNotInstalled(); // Set java to not installed 124 // $this->javaNotInstalled(); // Set java to not installed
125 // $this->setJava(); // Check if java has been auto detected 125 // $this->setJava(); // Check if java has been auto detected
126 } 126 }
127 - 127 +
128 /** 128 /**
129 * Check if java executable was found 129 * Check if java executable was found
130 * 130 *
@@ -140,7 +140,7 @@ class luceneValidation extends serviceValidation { @@ -140,7 +140,7 @@ class luceneValidation extends serviceValidation {
140 $this->temp_variables['java']['location'] = $this->java; 140 $this->temp_variables['java']['location'] = $this->java;
141 return ; 141 return ;
142 } 142 }
143 - 143 +
144 $this->temp_variables['java']['location'] = $this->java; 144 $this->temp_variables['java']['location'] = $this->java;
145 } 145 }
146 146
@@ -156,7 +156,7 @@ class luceneValidation extends serviceValidation { @@ -156,7 +156,7 @@ class luceneValidation extends serviceValidation {
156 $this->temp_variables['java']['class'] = 'tick'; 156 $this->temp_variables['java']['class'] = 'tick';
157 $this->temp_variables['java']['found'] = "Java Runtime Installed"; 157 $this->temp_variables['java']['found'] = "Java Runtime Installed";
158 } 158 }
159 - 159 +
160 /** 160 /**
161 * Store Java state as not installed 161 * Store Java state as not installed
162 * 162 *
@@ -169,7 +169,7 @@ class luceneValidation extends serviceValidation { @@ -169,7 +169,7 @@ class luceneValidation extends serviceValidation {
169 $this->temp_variables['java']['class'] = 'cross'; 169 $this->temp_variables['java']['class'] = 'cross';
170 $this->temp_variables['java']['found'] = "Java runtime environment required"; 170 $this->temp_variables['java']['found'] = "Java runtime environment required";
171 } 171 }
172 - 172 +
173 /** 173 /**
174 * Store Java version state as correct 174 * Store Java version state as correct
175 * 175 *
@@ -182,7 +182,7 @@ class luceneValidation extends serviceValidation { @@ -182,7 +182,7 @@ class luceneValidation extends serviceValidation {
182 $this->temp_variables['version']['class'] = 'tick'; 182 $this->temp_variables['version']['class'] = 'tick';
183 $this->temp_variables['version']['found'] = "Java Version 1.5+ Installed"; 183 $this->temp_variables['version']['found'] = "Java Version 1.5+ Installed";
184 } 184 }
185 - 185 +
186 /** 186 /**
187 * Store Java version state as warning 187 * Store Java version state as warning
188 * @author KnowledgeTree Team 188 * @author KnowledgeTree Team
@@ -194,7 +194,7 @@ class luceneValidation extends serviceValidation { @@ -194,7 +194,7 @@ class luceneValidation extends serviceValidation {
194 $this->temp_variables['version']['class'] = 'cross_orange'; 194 $this->temp_variables['version']['class'] = 'cross_orange';
195 $this->temp_variables['version']['found'] = "Java Runtime Version Cannot be detected"; 195 $this->temp_variables['version']['found'] = "Java Runtime Version Cannot be detected";
196 } 196 }
197 - 197 +
198 /** 198 /**
199 * Store Java version as state incorrect 199 * Store Java version as state incorrect
200 * 200 *
@@ -207,7 +207,7 @@ class luceneValidation extends serviceValidation { @@ -207,7 +207,7 @@ class luceneValidation extends serviceValidation {
207 $this->temp_variables['version']['class'] = 'cross'; 207 $this->temp_variables['version']['class'] = 'cross';
208 $this->temp_variables['version']['found'] = "Requires Java 1.5+ to be installed"; 208 $this->temp_variables['version']['found'] = "Requires Java 1.5+ to be installed";
209 } 209 }
210 - 210 +
211 /** 211 /**
212 * Store Zend Bridge state as installed 212 * Store Zend Bridge state as installed
213 * 213 *
@@ -220,10 +220,10 @@ class luceneValidation extends serviceValidation { @@ -220,10 +220,10 @@ class luceneValidation extends serviceValidation {
220 $this->temp_variables['extensions']['class'] = 'tick'; 220 $this->temp_variables['extensions']['class'] = 'tick';
221 $this->temp_variables['extensions']['found'] = "Java Bridge Installed"; 221 $this->temp_variables['extensions']['found'] = "Java Bridge Installed";
222 } 222 }
223 - 223 +
224 /** 224 /**
225 * Store Zend Bridge state as not installed 225 * Store Zend Bridge state as not installed
226 - * 226 + *
227 * @author KnowledgeTree Team 227 * @author KnowledgeTree Team
228 * @param none 228 * @param none
229 * @access private 229 * @access private
@@ -233,7 +233,7 @@ class luceneValidation extends serviceValidation { @@ -233,7 +233,7 @@ class luceneValidation extends serviceValidation {
233 $this->temp_variables['extensions']['class'] = 'cross_orange'; 233 $this->temp_variables['extensions']['class'] = 'cross_orange';
234 $this->temp_variables['extensions']['found'] = "Zend Java Bridge Not Installed"; 234 $this->temp_variables['extensions']['found'] = "Zend Java Bridge Not Installed";
235 } 235 }
236 - 236 +
237 /** 237 /**
238 * Store Zend Bridge state as warning 238 * Store Zend Bridge state as warning
239 * 239 *
@@ -246,18 +246,18 @@ class luceneValidation extends serviceValidation { @@ -246,18 +246,18 @@ class luceneValidation extends serviceValidation {
246 $this->temp_variables['extensions']['class'] = 'cross_orange'; 246 $this->temp_variables['extensions']['class'] = 'cross_orange';
247 $this->temp_variables['extensions']['found'] = "Zend Java Bridge Not Functional"; 247 $this->temp_variables['extensions']['found'] = "Zend Java Bridge Not Functional";
248 } 248 }
249 - 249 +
250 public function installed() { 250 public function installed() {
251 $this->disableExtension = true; // Disable the use of the php bridge extension 251 $this->disableExtension = true; // Disable the use of the php bridge extension
252 $this->javaVersionCorrect(); 252 $this->javaVersionCorrect();
253 $this->javaInstalled(); 253 $this->javaInstalled();
254 $this->javaCheck = 'tick'; 254 $this->javaCheck = 'tick';
255 } 255 }
256 - 256 +
257 public function getBinary() { 257 public function getBinary() {
258 $this->java = $this->util->getJava(); 258 $this->java = $this->util->getJava();
259 } 259 }
260 - 260 +
261 /** 261 /**
262 * Do some basic checks to help the user overcome java problems 262 * Do some basic checks to help the user overcome java problems
263 * 263 *
@@ -267,7 +267,7 @@ class luceneValidation extends serviceValidation { @@ -267,7 +267,7 @@ class luceneValidation extends serviceValidation {
267 * @return boolean 267 * @return boolean
268 */ 268 */
269 public function binaryChecks() { 269 public function binaryChecks() {
270 - $java = $this->useZendJava(); 270 + $java = $this->util->useZendJava();
271 if(!$java) { 271 if(!$java) {
272 if($this->util->javaSpecified()) { 272 if($this->util->javaSpecified()) {
273 $this->disableExtension = true; // Disable the use of the php bridge extension 273 $this->disableExtension = true; // Disable the use of the php bridge extension
@@ -292,10 +292,10 @@ class luceneValidation extends serviceValidation { @@ -292,10 +292,10 @@ class luceneValidation extends serviceValidation {
292 return $auto; 292 return $auto;
293 } 293 }
294 } 294 }
295 - 295 +
296 return $java; 296 return $java;
297 } 297 }
298 - 298 +
299 /** 299 /**
300 * Set template view to specify java 300 * Set template view to specify java
301 * 301 *
@@ -307,7 +307,7 @@ class luceneValidation extends serviceValidation { @@ -307,7 +307,7 @@ class luceneValidation extends serviceValidation {
307 private function specifyJava() { 307 private function specifyJava() {
308 $this->javaExeError = true; 308 $this->javaExeError = true;
309 } 309 }
310 - 310 +
311 /** 311 /**
312 * Attempts to use bridge and configure java settings 312 * Attempts to use bridge and configure java settings
313 * 313 *
@@ -348,7 +348,7 @@ class luceneValidation extends serviceValidation { @@ -348,7 +348,7 @@ class luceneValidation extends serviceValidation {
348 return false; 348 return false;
349 } 349 }
350 } 350 }
351 - 351 +
352 /** 352 /**
353 * Check if Zend Bridge is functional 353 * Check if Zend Bridge is functional
354 * 354 *
@@ -362,33 +362,9 @@ class luceneValidation extends serviceValidation { @@ -362,33 +362,9 @@ class luceneValidation extends serviceValidation {
362 return true; 362 return true;
363 } else { 363 } else {
364 return false; 364 return false;
365 - }  
366 - }  
367 -  
368 - public function useZendJava() {  
369 - if($this->util->installEnvironment() == 'Zend') {  
370 - if(WINDOWS_OS) { // For Zend Installation only  
371 - $sysdir = explode(DS, SYSTEM_DIR);  
372 - array_pop($sysdir);  
373 - array_pop($sysdir);  
374 - $zendsys = '';  
375 - foreach ($sysdir as $k=>$v) {  
376 - $zendsys .= $v.DS;  
377 - }  
378 - $java = $zendsys."jre".DS."bin".DS."java.exe";  
379 - if(file_exists($java))  
380 - return $java;  
381 - } else {  
382 - $java = "/usr/bin/java";  
383 - if(file_exists($java)) {  
384 - return $java;  
385 - }  
386 - }  
387 - }  
388 -  
389 - return false; 365 + }
390 } 366 }
391 - 367 +
392 /** 368 /**
393 * Attempts to use user input and configure java settings 369 * Attempts to use user input and configure java settings
394 * 370 *
@@ -405,13 +381,13 @@ class luceneValidation extends serviceValidation { @@ -405,13 +381,13 @@ class luceneValidation extends serviceValidation {
405 } 381 }
406 $javaExecutable = $this->java; 382 $javaExecutable = $this->java;
407 } 383 }
408 - if(WINDOWS_OS) { 384 + if(WINDOWS_OS) {
409 $cmd = "\"$javaExecutable\" -cp \"".SYS_DIR.";\" javaVersion \"".$this->outputDir."outJV\""." \"".$this->outputDir."outJVHome\""; 385 $cmd = "\"$javaExecutable\" -cp \"".SYS_DIR.";\" javaVersion \"".$this->outputDir."outJV\""." \"".$this->outputDir."outJVHome\"";
410 $func = OS."ReadJVFromFile"; 386 $func = OS."ReadJVFromFile";
411 if($this->$func($cmd)) { 387 if($this->$func($cmd)) {
412 return true; 388 return true;
413 } else { 389 } else {
414 - $this->java = $this->useZendJava(); // Java not installed 390 + $this->java = $this->util->useZendJava(); // Java not installed
415 $javaExecutable = $this->java; 391 $javaExecutable = $this->java;
416 $cmd = "\"$javaExecutable\" -cp \"".SYS_DIR.";\" javaVersion \"".$this->outputDir."outJV\""." \"".$this->outputDir."outJVHome\""; 392 $cmd = "\"$javaExecutable\" -cp \"".SYS_DIR.";\" javaVersion \"".$this->outputDir."outJV\""." \"".$this->outputDir."outJVHome\"";
417 if($this->$func($cmd)) { 393 if($this->$func($cmd)) {
@@ -422,7 +398,7 @@ class luceneValidation extends serviceValidation { @@ -422,7 +398,7 @@ class luceneValidation extends serviceValidation {
422 $cmd = "\"$javaExecutable\" -version > ".$this->outputDir."outJV 2>&1 echo $!"; 398 $cmd = "\"$javaExecutable\" -version > ".$this->outputDir."outJV 2>&1 echo $!";
423 $func = OS."ReadJVFromFile"; 399 $func = OS."ReadJVFromFile";
424 if($this->$func($cmd)) { 400 if($this->$func($cmd)) {
425 - return true; 401 + return true;
426 } else { 402 } else {
427 // TODO: Not sure 403 // TODO: Not sure
428 } 404 }
@@ -433,7 +409,7 @@ class luceneValidation extends serviceValidation { @@ -433,7 +409,7 @@ class luceneValidation extends serviceValidation {
433 $this->error[] = "Requires Java 1.5+ to be installed"; 409 $this->error[] = "Requires Java 1.5+ to be installed";
434 return false; 410 return false;
435 } 411 }
436 - 412 +
437 function windowsReadJVFromFile($cmd) { 413 function windowsReadJVFromFile($cmd) {
438 $response = $this->util->pexec($cmd); 414 $response = $this->util->pexec($cmd);
439 if(file_exists($this->outputDir.'outJV')) { 415 if(file_exists($this->outputDir.'outJV')) {
@@ -443,14 +419,14 @@ class luceneValidation extends serviceValidation { @@ -443,14 +419,14 @@ class luceneValidation extends serviceValidation {
443 $this->javaVersionInCorrect(); 419 $this->javaVersionInCorrect();
444 $this->javaCheck = 'cross'; 420 $this->javaCheck = 'cross';
445 $this->error[] = "Requires Java 1.5+ to be installed"; 421 $this->error[] = "Requires Java 1.5+ to be installed";
446 - 422 +
447 return false; 423 return false;
448 } else { 424 } else {
449 $this->javaVersionCorrect(); 425 $this->javaVersionCorrect();
450 $this->javaInstalled(); 426 $this->javaInstalled();
451 $this->javaCheck = 'tick'; 427 $this->javaCheck = 'tick';
452 $this->providedJava = true; 428 $this->providedJava = true;
453 - 429 +
454 return true; 430 return true;
455 } 431 }
456 } else { 432 } else {
@@ -461,12 +437,12 @@ class luceneValidation extends serviceValidation { @@ -461,12 +437,12 @@ class luceneValidation extends serviceValidation {
461 $this->javaExeError = true; 437 $this->javaExeError = true;
462 $this->error[] = "Requires Java 1.5+ to be installed"; 438 $this->error[] = "Requires Java 1.5+ to be installed";
463 } 439 }
464 - 440 +
465 return false; 441 return false;
466 } 442 }
467 } 443 }
468 } 444 }
469 - 445 +
470 function unixReadJVFromFile($cmd) { 446 function unixReadJVFromFile($cmd) {
471 $response = $this->util->pexec($cmd); 447 $response = $this->util->pexec($cmd);
472 if(file_exists($this->outputDir.'outJV')) { 448 if(file_exists($this->outputDir.'outJV')) {
@@ -477,14 +453,14 @@ class luceneValidation extends serviceValidation { @@ -477,14 +453,14 @@ class luceneValidation extends serviceValidation {
477 $this->javaVersionInCorrect(); 453 $this->javaVersionInCorrect();
478 $this->javaCheck = 'cross'; 454 $this->javaCheck = 'cross';
479 $this->error[] = "Requires Java 1.5+ to be installed"; 455 $this->error[] = "Requires Java 1.5+ to be installed";
480 - 456 +
481 return false; 457 return false;
482 } else { 458 } else {
483 $this->javaVersionCorrect(); 459 $this->javaVersionCorrect();
484 $this->javaInstalled(); 460 $this->javaInstalled();
485 $this->javaCheck = 'tick'; 461 $this->javaCheck = 'tick';
486 $this->providedJava = true; 462 $this->providedJava = true;
487 - 463 +
488 return true; 464 return true;
489 } 465 }
490 } else { 466 } else {
@@ -495,12 +471,12 @@ class luceneValidation extends serviceValidation { @@ -495,12 +471,12 @@ class luceneValidation extends serviceValidation {
495 $this->javaExeError = true; 471 $this->javaExeError = true;
496 $this->error[] = "Requires Java 1.5+ to be installed"; 472 $this->error[] = "Requires Java 1.5+ to be installed";
497 } 473 }
498 - 474 +
499 return false; 475 return false;
500 } 476 }
501 } 477 }
502 } 478 }
503 - 479 +
504 /** 480 /**
505 * Set all silent mode varibles 481 * Set all silent mode varibles
506 * 482 *