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