Commit e606aef6aed918b225ff1ab0c7d1941352ca8710
Merge branch 'edge' of github.com:ktgit/knowledgetree into edge
Showing
7 changed files
with
69 additions
and
14 deletions
setup/wizard/lib/services/windowsLucene.php
| ... | ... | @@ -403,6 +403,10 @@ class windowsLucene extends windowsService { |
| 403 | 403 | $luceneDir = $this->getluceneDir(); |
| 404 | 404 | if($luceneExe && $luceneSource && $luceneDir) { |
| 405 | 405 | $cmd = "\"{$luceneExe}\""." -install \"".$this->getName()."\" \"".$this->getJavaJVM(). "\" -Djava.class.path=\"".$luceneSource."\"". " -start ".$this->getLuceneServer(). " -out \"".$this->getLuceneOut()."\" -err \"".$this->getLuceneError()."\" -current \"".$luceneDir."\" -auto"; |
| 406 | + if(DEBUG) { | |
| 407 | + echo "$cmd<br/>"; | |
| 408 | + return ; | |
| 409 | + } | |
| 406 | 410 | $response = $this->util->pexec($cmd); |
| 407 | 411 | return $response; |
| 408 | 412 | } |
| ... | ... | @@ -424,7 +428,8 @@ class windowsLucene extends windowsService { |
| 424 | 428 | // Check if bin is readable and writable |
| 425 | 429 | if(is_readable(SYS_BIN_DIR) && is_writable(SYS_BIN_DIR)) { |
| 426 | 430 | if($this->getluceneDir()) { |
| 427 | - $fp = fopen($this->getluceneDir()."KnowledgeTreeIndexer.properties", "w+"); | |
| 431 | + $propPath = $this->getluceneDir().DS."KnowledgeTreeIndexer.properties"; | |
| 432 | + $fp = fopen($propPath, "w+"); | |
| 428 | 433 | $content = "server.port=8875\n"; |
| 429 | 434 | $content .= "server.paranoid=false\n"; |
| 430 | 435 | $content .= "server.accept=127.0.0.1\n"; |
| ... | ... | @@ -434,6 +439,8 @@ class windowsLucene extends windowsService { |
| 434 | 439 | fwrite($fp, $content); |
| 435 | 440 | fclose($fp); |
| 436 | 441 | } |
| 442 | + } else { | |
| 443 | + //TODO: Should not get here | |
| 437 | 444 | } |
| 438 | 445 | } |
| 439 | 446 | } | ... | ... |
setup/wizard/lib/services/windowsOpenOffice.php
| ... | ... | @@ -192,8 +192,7 @@ class windowsOpenOffice extends windowsService { |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | private function setOption() { |
| 195 | - //print_r($this->getBin()); | |
| 196 | - $this->options = "-displayname {$this->name} -start auto -binary {$this->getBin()} -headless -invisible -nofirststartwizard" | |
| 195 | + $this->options = "-displayname {$this->name} -start auto {$this->getBin()} -headless -invisible -nofirststartwizard" | |
| 197 | 196 | . "-accept=\"socket,host={$this->host},port={$this->port};urp;StarOffice.ServiceManager\""; |
| 198 | 197 | } |
| 199 | 198 | |
| ... | ... | @@ -208,6 +207,10 @@ class windowsOpenOffice extends windowsService { |
| 208 | 207 | $this->setBin("{$services['openOfficeExe']}"); |
| 209 | 208 | $this->setOption(); |
| 210 | 209 | $cmd = "\"{$this->winservice}\" install $this->name {$this->getOption()}"; |
| 210 | + if(DEBUG) { | |
| 211 | + echo "$cmd<br/>"; | |
| 212 | + return ; | |
| 213 | + } | |
| 211 | 214 | $response = $this->util->pexec($cmd); |
| 212 | 215 | return $response; |
| 213 | 216 | } | ... | ... |
setup/wizard/lib/services/windowsScheduler.php
| ... | ... | @@ -215,6 +215,10 @@ class windowsScheduler extends windowsService { |
| 215 | 215 | $this->setWinservice(); |
| 216 | 216 | $this->setOptions(); |
| 217 | 217 | $cmd = "\"{$this->winservice}\" install $this->name $this->options"; |
| 218 | + if(DEBUG) { | |
| 219 | + echo "$cmd<br/>"; | |
| 220 | + return ; | |
| 221 | + } | |
| 218 | 222 | $response = $this->util->pexec($cmd); |
| 219 | 223 | return $response; |
| 220 | 224 | } | ... | ... |
setup/wizard/output/outJV deleted
setup/wizard/steps/complete.php
| ... | ... | @@ -226,8 +226,7 @@ class complete extends Step { |
| 226 | 226 | foreach ($services->getServices() as $serviceName) { |
| 227 | 227 | $className = OS.$serviceName; |
| 228 | 228 | $service = new $className(); |
| 229 | - $service->load(); | |
| 230 | - $status = $services->serviceStatus($service); | |
| 229 | + $status = $services->serviceStarted($service); | |
| 231 | 230 | if($status) { |
| 232 | 231 | $this->temp_variables[$serviceName."Status"] = 'tick'; |
| 233 | 232 | } else { | ... | ... |
setup/wizard/steps/services.php
| ... | ... | @@ -445,7 +445,7 @@ class services extends Step |
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | private function openOfficeInstalled() { |
| 448 | - $this->openOfficeExeError = false; | |
| 448 | + | |
| 449 | 449 | } |
| 450 | 450 | |
| 451 | 451 | private function schedulerInstalled() { |
| ... | ... | @@ -474,7 +474,7 @@ class services extends Step |
| 474 | 474 | $className = OS.$serviceName; |
| 475 | 475 | $service = new $className(); |
| 476 | 476 | $service->load(); |
| 477 | - $status = $this->serviceStatus($service); | |
| 477 | + $status = $this->serviceInstalled($service); | |
| 478 | 478 | if($status != 'STARTED') { |
| 479 | 479 | $msg = $service->getName()." Could not be added as a Service"; |
| 480 | 480 | $this->temp_variables['services'][] = array('class'=>'cross_orange', 'msg'=>$msg); |
| ... | ... | @@ -505,7 +505,7 @@ class services extends Step |
| 505 | 505 | foreach ($serverDetails as $serviceName) { |
| 506 | 506 | $className = OS.$serviceName; |
| 507 | 507 | $service = new $className(); |
| 508 | - $status = $this->serviceStatus($service); | |
| 508 | + $status = $this->serviceInstalled($service); | |
| 509 | 509 | $flag = strtolower(substr($serviceName,0,1)).substr($serviceName,1)."Installed"; |
| 510 | 510 | if(!$status) { |
| 511 | 511 | $allInstalled = false; |
| ... | ... | @@ -822,19 +822,64 @@ class services extends Step |
| 822 | 822 | } |
| 823 | 823 | |
| 824 | 824 | /** |
| 825 | - * Returns service status | |
| 825 | + * Helper to check if service is installed | |
| 826 | 826 | * |
| 827 | 827 | * @author KnowledgeTree Team |
| 828 | 828 | * @param object |
| 829 | 829 | * @access public |
| 830 | 830 | * @return string |
| 831 | 831 | */ |
| 832 | - public function serviceStatus($service) { | |
| 832 | + public function serviceInstalled($service) { | |
| 833 | 833 | $statusCheck = OS."ServiceInstalled"; |
| 834 | 834 | return $this->$statusCheck($service); |
| 835 | 835 | } |
| 836 | 836 | |
| 837 | 837 | /** |
| 838 | + * Helper to check if service is started | |
| 839 | + * | |
| 840 | + * @author KnowledgeTree Team | |
| 841 | + * @param object | |
| 842 | + * @access public | |
| 843 | + * @return string | |
| 844 | + */ | |
| 845 | + public function serviceStarted($service) { | |
| 846 | + $statusCheck = OS."ServiceStarted"; | |
| 847 | + return $this->$statusCheck($service); | |
| 848 | + } | |
| 849 | + | |
| 850 | + /** | |
| 851 | + * Check if windows service installed | |
| 852 | + * | |
| 853 | + * @author KnowledgeTree Team | |
| 854 | + * @param object | |
| 855 | + * @access public | |
| 856 | + * @return boolean | |
| 857 | + */ | |
| 858 | + public function windowsServiceStarted($service) { | |
| 859 | + $status = $service->status(); // Check if service has been installed | |
| 860 | + if($status != 'RUNNING') { // Check service status | |
| 861 | + return false; | |
| 862 | + } | |
| 863 | + return true; | |
| 864 | + } | |
| 865 | + | |
| 866 | + /** | |
| 867 | + * Check if unix service installed | |
| 868 | + * | |
| 869 | + * @author KnowledgeTree Team | |
| 870 | + * @param object | |
| 871 | + * @access public | |
| 872 | + * @return boolean | |
| 873 | + */ | |
| 874 | + public function unixServiceStarted($service) { | |
| 875 | + $status = $service->status(); // Check if service has been installed | |
| 876 | + if($status != 'STARTED') { // Check service status | |
| 877 | + return false; | |
| 878 | + } | |
| 879 | + return true; | |
| 880 | + } | |
| 881 | + | |
| 882 | + /** | |
| 838 | 883 | * Check if windows service installed |
| 839 | 884 | * |
| 840 | 885 | * @author KnowledgeTree Team | ... | ... |
setup/wizard/templates/services.tpl
| ... | ... | @@ -65,7 +65,7 @@ |
| 65 | 65 | <?php if($openOfficeExeError) { ?> |
| 66 | 66 | Specify the location of your Open Office executable |
| 67 | 67 | |
| 68 | - <input name='soffice' id='port' size='25' value='<?php echo $soffice['location']; ?>' style="float:none;"/> | |
| 68 | + <input name='soffice' id='port' size='25' value='<?php if(isset($soffice['location'])) echo $soffice['location']; ?>' style="float:none;"/> | |
| 69 | 69 | |
| 70 | 70 | <a href="javascript:{w.sendJavaLocation();}" class="specify">Submit</a> |
| 71 | 71 | <br/> | ... | ... |