Commit 10fc883fb38fff9bcfc67d85b512fd26a1551c39
1 parent
89d4366e
Story Id:778902 Updated Office Service
Committed by: Jarrett Jordaan Reviewed by: Paul Barrett
Showing
1 changed file
with
60 additions
and
0 deletions
setup/wizard/lib/services/unixOpenOffice.php
| ... | ... | @@ -42,10 +42,70 @@ |
| 42 | 42 | |
| 43 | 43 | class unixOpenOffice extends unixService { |
| 44 | 44 | |
| 45 | + // utility | |
| 46 | + public $util; | |
| 47 | + // path to office | |
| 48 | + private $path; | |
| 49 | + // host | |
| 50 | + private $host; | |
| 51 | + // pid running | |
| 52 | + private $pidFile; | |
| 53 | + // port to bind to | |
| 54 | + private $port; | |
| 55 | + // bin folder | |
| 56 | + private $bin; | |
| 57 | + // office executable | |
| 58 | + private $soffice; | |
| 59 | + // office log file | |
| 60 | + private $log; | |
| 61 | + | |
| 62 | + # nohup /home/jarrett/ktdms/openoffice/program/soffice.bin -nofirststartwizard -nologo -headless -accept=socket,host=127.0.0.1,port=8100;urp;StarOffice.ServiceManager &> /home/jarrett/ktdms/var/log/dmsctl.log & | |
| 45 | 63 | public function __construct() { |
| 46 | 64 | $this->name = "KTOpenOfficeTest"; |
| 65 | + $this->util = new InstallUtil(); | |
| 66 | + } | |
| 67 | + | |
| 68 | + public function load() { | |
| 69 | + $this->setPort("8100"); | |
| 70 | + $this->setHost("localhost"); | |
| 71 | + | |
| 47 | 72 | } |
| 48 | 73 | |
| 74 | + private function setPort($port = "8100") { | |
| 75 | + $this->port = $port; | |
| 76 | + } | |
| 77 | + | |
| 78 | + private function setHost($host = "localhost") { | |
| 79 | + $this->host = $host; | |
| 80 | + } | |
| 49 | 81 | |
| 82 | + public function install() { | |
| 83 | + $status = $this->status(); | |
| 84 | + if($status == '') { | |
| 85 | + return $this->start(); | |
| 86 | + } else { | |
| 87 | + return $status; | |
| 88 | + } | |
| 89 | + } | |
| 90 | + | |
| 91 | + public function start() { | |
| 92 | + return false; | |
| 93 | + $state = $this->status(); | |
| 94 | + if($state != 'STARTED') { | |
| 95 | + $cmd = ""; | |
| 96 | + $cmd .= ""; | |
| 97 | + $response = $this->util->pexec($cmd); | |
| 98 | + | |
| 99 | + return $response; | |
| 100 | + } elseif ($state == '') { | |
| 101 | + // Start Service | |
| 102 | + return true; | |
| 103 | + } else { | |
| 104 | + // Service Running Already | |
| 105 | + return true; | |
| 106 | + } | |
| 107 | + | |
| 108 | + return false; | |
| 109 | + } | |
| 50 | 110 | } |
| 51 | 111 | ?> |
| 52 | 112 | \ No newline at end of file | ... | ... |