Commit 31d09f1d68e2b36d126a97c9e4b6e3bca5078813
1 parent
d2dc48c0
KTS4498-Updated windows paths
Committed by: Jarrett Jordaan Reviewed by: Prince Mbekwa
Showing
2 changed files
with
60 additions
and
59 deletions
setup/wizard/installUtil.php
| ... | ... | @@ -762,6 +762,26 @@ class InstallUtil { |
| 762 | 762 | return false; |
| 763 | 763 | } |
| 764 | 764 | |
| 765 | + public function useZendJVM() { | |
| 766 | + if($this->util->installEnvironment() == 'Zend') { | |
| 767 | + if(WINDOWS_OS) { // For Zend Installation only | |
| 768 | + $sysdir = explode(DS, SYSTEM_DIR); | |
| 769 | + array_pop($sysdir); | |
| 770 | + array_pop($sysdir); | |
| 771 | + array_pop($sysdir); | |
| 772 | + $zendsys = ''; | |
| 773 | + foreach ($sysdir as $v) { | |
| 774 | + $zendsys .= $v.DS; | |
| 775 | + } | |
| 776 | + $jvm = $zendsys."jre".DS."bin".DS."client".DS."jvm.dll"; | |
| 777 | + if(file_exists($jvm)) | |
| 778 | + return $jvm; | |
| 779 | + } | |
| 780 | + } | |
| 781 | + | |
| 782 | + return false; | |
| 783 | + } | |
| 784 | + | |
| 765 | 785 | /** |
| 766 | 786 | * Determine if mysql exists |
| 767 | 787 | * | ... | ... |
setup/wizard/lib/services/windowsLucene.php
| ... | ... | @@ -45,19 +45,19 @@ class windowsLucene extends windowsService { |
| 45 | 45 | * |
| 46 | 46 | * @author KnowledgeTree Team |
| 47 | 47 | * @access private |
| 48 | - * @var string | |
| 48 | + * @var string | |
| 49 | 49 | */ |
| 50 | 50 | private $javaBin; |
| 51 | - | |
| 51 | + | |
| 52 | 52 | /** |
| 53 | 53 | * Java JVM path |
| 54 | 54 | * |
| 55 | 55 | * @author KnowledgeTree Team |
| 56 | 56 | * @access private |
| 57 | - * @var string | |
| 57 | + * @var string | |
| 58 | 58 | */ |
| 59 | 59 | private $javaJVM; |
| 60 | - | |
| 60 | + | |
| 61 | 61 | /** |
| 62 | 62 | * Java System object |
| 63 | 63 | * |
| ... | ... | @@ -66,61 +66,61 @@ class windowsLucene extends windowsService { |
| 66 | 66 | * @var object |
| 67 | 67 | */ |
| 68 | 68 | private $javaSystem; |
| 69 | - | |
| 69 | + | |
| 70 | 70 | /** |
| 71 | 71 | * Lucene executable path |
| 72 | 72 | * |
| 73 | 73 | * @author KnowledgeTree Team |
| 74 | 74 | * @access private |
| 75 | - * @var string | |
| 75 | + * @var string | |
| 76 | 76 | */ |
| 77 | 77 | private $luceneExe; |
| 78 | - | |
| 78 | + | |
| 79 | 79 | /** |
| 80 | 80 | * Lucene jar path |
| 81 | 81 | * |
| 82 | 82 | * @author KnowledgeTree Team |
| 83 | 83 | * @access private |
| 84 | - * @var string | |
| 84 | + * @var string | |
| 85 | 85 | */ |
| 86 | 86 | private $luceneSource; |
| 87 | - | |
| 87 | + | |
| 88 | 88 | /** |
| 89 | 89 | * Lucene package name |
| 90 | 90 | * |
| 91 | 91 | * @author KnowledgeTree Team |
| 92 | 92 | * @access private |
| 93 | - * @var string | |
| 93 | + * @var string | |
| 94 | 94 | */ |
| 95 | 95 | private $luceneServer; |
| 96 | - | |
| 96 | + | |
| 97 | 97 | /** |
| 98 | 98 | * Lucene output log path |
| 99 | 99 | * |
| 100 | 100 | * @author KnowledgeTree Team |
| 101 | 101 | * @access private |
| 102 | - * @var string | |
| 102 | + * @var string | |
| 103 | 103 | */ |
| 104 | 104 | private $luceneOut; |
| 105 | - | |
| 105 | + | |
| 106 | 106 | /** |
| 107 | 107 | * Lucene error log path |
| 108 | 108 | * |
| 109 | 109 | * @author KnowledgeTree Team |
| 110 | 110 | * @access private |
| 111 | - * @var string | |
| 111 | + * @var string | |
| 112 | 112 | */ |
| 113 | 113 | private $luceneError; |
| 114 | - | |
| 114 | + | |
| 115 | 115 | /** |
| 116 | 116 | * Lucene directory path |
| 117 | 117 | * |
| 118 | 118 | * @author KnowledgeTree Team |
| 119 | 119 | * @access private |
| 120 | - * @var string | |
| 120 | + * @var string | |
| 121 | 121 | */ |
| 122 | 122 | private $luceneDir; |
| 123 | - | |
| 123 | + | |
| 124 | 124 | |
| 125 | 125 | /** |
| 126 | 126 | * Service name |
| ... | ... | @@ -129,9 +129,9 @@ class windowsLucene extends windowsService { |
| 129 | 129 | * @access public |
| 130 | 130 | * @param none |
| 131 | 131 | * @return string |
| 132 | - */ | |
| 132 | + */ | |
| 133 | 133 | public $name = "KTLucene"; |
| 134 | - | |
| 134 | + | |
| 135 | 135 | /** |
| 136 | 136 | * Load defaults needed by service |
| 137 | 137 | * |
| ... | ... | @@ -150,7 +150,7 @@ class windowsLucene extends windowsService { |
| 150 | 150 | $this->setLuceneOut("lucene-out.txt"); |
| 151 | 151 | $this->setLuceneError("lucene-err.txt"); |
| 152 | 152 | } |
| 153 | - | |
| 153 | + | |
| 154 | 154 | /** |
| 155 | 155 | * Set Java Directory path |
| 156 | 156 | * |
| ... | ... | @@ -164,7 +164,7 @@ class windowsLucene extends windowsService { |
| 164 | 164 | if($this->util->javaBridge()) { |
| 165 | 165 | $this->javaSystem = new Java('java.lang.System'); |
| 166 | 166 | $this->javaBin = $this->javaSystem->getProperty('java.home').DS."bin"; |
| 167 | - | |
| 167 | + | |
| 168 | 168 | return true; |
| 169 | 169 | } |
| 170 | 170 | } |
| ... | ... | @@ -173,7 +173,7 @@ class windowsLucene extends windowsService { |
| 173 | 173 | $this->javaBin = file_get_contents($this->varDir.'outJVHome'); |
| 174 | 174 | if($this->javaBin != '') return true; |
| 175 | 175 | } |
| 176 | - | |
| 176 | + | |
| 177 | 177 | return false; |
| 178 | 178 | } |
| 179 | 179 | |
| ... | ... | @@ -188,7 +188,7 @@ class windowsLucene extends windowsService { |
| 188 | 188 | public function getJavaBin() { |
| 189 | 189 | return $this->javaBin; |
| 190 | 190 | } |
| 191 | - | |
| 191 | + | |
| 192 | 192 | /** |
| 193 | 193 | * Set Lucene directory path |
| 194 | 194 | * |
| ... | ... | @@ -200,7 +200,7 @@ class windowsLucene extends windowsService { |
| 200 | 200 | private function setLuceneDIR($luceneDir) { |
| 201 | 201 | $this->luceneDir = $luceneDir; |
| 202 | 202 | } |
| 203 | - | |
| 203 | + | |
| 204 | 204 | /** |
| 205 | 205 | * Get Lucene directory path |
| 206 | 206 | * |
| ... | ... | @@ -226,7 +226,7 @@ class windowsLucene extends windowsService { |
| 226 | 226 | private function setLuceneExe($luceneExe) { |
| 227 | 227 | $this->luceneExe = $this->getluceneDir().DS.$luceneExe; |
| 228 | 228 | } |
| 229 | - | |
| 229 | + | |
| 230 | 230 | /** |
| 231 | 231 | * Get Lucene executable path |
| 232 | 232 | * |
| ... | ... | @@ -240,7 +240,7 @@ class windowsLucene extends windowsService { |
| 240 | 240 | return $this->luceneExe; |
| 241 | 241 | return false; |
| 242 | 242 | } |
| 243 | - | |
| 243 | + | |
| 244 | 244 | /** |
| 245 | 245 | * Set Lucene source path |
| 246 | 246 | * |
| ... | ... | @@ -252,7 +252,7 @@ class windowsLucene extends windowsService { |
| 252 | 252 | private function setLuceneSource($luceneSource) { |
| 253 | 253 | $this->luceneSource = $this->getluceneDir().DS.$luceneSource; |
| 254 | 254 | } |
| 255 | - | |
| 255 | + | |
| 256 | 256 | /** |
| 257 | 257 | * Get Lucene source path |
| 258 | 258 | * |
| ... | ... | @@ -266,7 +266,7 @@ class windowsLucene extends windowsService { |
| 266 | 266 | return $this->luceneSource; |
| 267 | 267 | return false; |
| 268 | 268 | } |
| 269 | - | |
| 269 | + | |
| 270 | 270 | /** |
| 271 | 271 | * Set Lucene package name |
| 272 | 272 | * |
| ... | ... | @@ -278,7 +278,7 @@ class windowsLucene extends windowsService { |
| 278 | 278 | private function setLuceneServer($luceneServer) { |
| 279 | 279 | $this->luceneServer = $luceneServer; |
| 280 | 280 | } |
| 281 | - | |
| 281 | + | |
| 282 | 282 | /** |
| 283 | 283 | * Get Lucene package name |
| 284 | 284 | * |
| ... | ... | @@ -290,7 +290,7 @@ class windowsLucene extends windowsService { |
| 290 | 290 | public function getLuceneServer() { |
| 291 | 291 | return $this->luceneServer; |
| 292 | 292 | } |
| 293 | - | |
| 293 | + | |
| 294 | 294 | /** |
| 295 | 295 | * Set Lucene output file path |
| 296 | 296 | * |
| ... | ... | @@ -302,7 +302,7 @@ class windowsLucene extends windowsService { |
| 302 | 302 | private function setLuceneOut($luceneOut) { |
| 303 | 303 | $this->luceneOut = $this->outputDir.$luceneOut; |
| 304 | 304 | } |
| 305 | - | |
| 305 | + | |
| 306 | 306 | /** |
| 307 | 307 | * Get Lucene output file path |
| 308 | 308 | * |
| ... | ... | @@ -314,7 +314,7 @@ class windowsLucene extends windowsService { |
| 314 | 314 | public function getLuceneOut() { |
| 315 | 315 | return $this->luceneOut; |
| 316 | 316 | } |
| 317 | - | |
| 317 | + | |
| 318 | 318 | /** |
| 319 | 319 | * Set Lucene error file path |
| 320 | 320 | * |
| ... | ... | @@ -326,7 +326,7 @@ class windowsLucene extends windowsService { |
| 326 | 326 | private function setLuceneError($luceneError) { |
| 327 | 327 | $this->luceneError = $this->outputDir.$luceneError; |
| 328 | 328 | } |
| 329 | - | |
| 329 | + | |
| 330 | 330 | /** |
| 331 | 331 | * Get Lucene error file path |
| 332 | 332 | * |
| ... | ... | @@ -338,7 +338,7 @@ class windowsLucene extends windowsService { |
| 338 | 338 | public function getLuceneError() { |
| 339 | 339 | return $this->luceneError; |
| 340 | 340 | } |
| 341 | - | |
| 341 | + | |
| 342 | 342 | /** |
| 343 | 343 | * Set Java JVM path |
| 344 | 344 | * |
| ... | ... | @@ -357,32 +357,13 @@ class windowsLucene extends windowsService { |
| 357 | 357 | } elseif (file_exists($this->getJavaBin().DS."bin".DS."server".DS."jvm.dll")) { |
| 358 | 358 | $this->javaJVM = $this->getJavaBin().DS."bin".DS."server".DS."jvm.dll"; |
| 359 | 359 | } else { |
| 360 | - $javaJVM = $this->useZendJVM(); | |
| 360 | + $javaJVM = $this->util->useZendJVM(); | |
| 361 | 361 | if(file_exists($javaJVM)) { |
| 362 | 362 | $this->javaJVM = $javaJVM; |
| 363 | 363 | } |
| 364 | 364 | } |
| 365 | 365 | } |
| 366 | - | |
| 367 | - public function useZendJVM() { | |
| 368 | - if($this->util->installEnvironment() == 'Zend') { | |
| 369 | - if(WINDOWS_OS) { // For Zend Installation only | |
| 370 | - $sysdir = explode(DS, SYSTEM_DIR); | |
| 371 | - array_pop($sysdir); | |
| 372 | - array_pop($sysdir); | |
| 373 | - $zendsys = ''; | |
| 374 | - foreach ($sysdir as $v) { | |
| 375 | - $zendsys .= $v.DS; | |
| 376 | - } | |
| 377 | - $jvm = $zendsys."jre".DS."bin".DS."client".DS."jvm.dll"; | |
| 378 | - if(file_exists($jvm)) | |
| 379 | - return $jvm; | |
| 380 | - } | |
| 381 | - } | |
| 382 | - | |
| 383 | - return false; | |
| 384 | - } | |
| 385 | - | |
| 366 | + | |
| 386 | 367 | /** |
| 387 | 368 | * Get Java JVM path |
| 388 | 369 | * |
| ... | ... | @@ -394,7 +375,7 @@ class windowsLucene extends windowsService { |
| 394 | 375 | public function getJavaJVM() { |
| 395 | 376 | return $this->javaJVM; |
| 396 | 377 | } |
| 397 | - | |
| 378 | + | |
| 398 | 379 | private function writeLuceneInstall($cmd) { |
| 399 | 380 | $luceneInstallFile = SYS_VAR_DIR."bin".DS."luceneinstall.bat"; |
| 400 | 381 | $fp = fopen($luceneInstallFile, "w+"); |
| ... | ... | @@ -428,10 +409,10 @@ class windowsLucene extends windowsService { |
| 428 | 409 | } |
| 429 | 410 | return $state; |
| 430 | 411 | } |
| 431 | - | |
| 412 | + | |
| 432 | 413 | return $state; |
| 433 | 414 | } |
| 434 | - | |
| 415 | + | |
| 435 | 416 | /** |
| 436 | 417 | * Start Service |
| 437 | 418 | * |
| ... | ... | @@ -459,7 +440,7 @@ class windowsLucene extends windowsService { |
| 459 | 440 | $state = preg_replace('/^STATE *\: *\d */', '', trim($response['out'][3])); // Status store in third key |
| 460 | 441 | return $state; |
| 461 | 442 | } |
| 462 | - | |
| 443 | + | |
| 463 | 444 | return ''; |
| 464 | 445 | } |
| 465 | 446 | } | ... | ... |