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