Commit 23a3796d381538d1e0d928719797804aecef8092
1 parent
6c7e5e46
Undefined Fixed
Committed by: Jarrett Jordaan Reviewed by: Prince Mbekwa
Showing
1 changed file
with
25 additions
and
25 deletions
setup/wizard/lib/services/windowsOpenOffice.php
| @@ -49,7 +49,7 @@ class windowsOpenOffice extends windowsService { | @@ -49,7 +49,7 @@ class windowsOpenOffice extends windowsService { | ||
| 49 | * @var string | 49 | * @var string |
| 50 | */ | 50 | */ |
| 51 | private $path; | 51 | private $path; |
| 52 | - | 52 | + |
| 53 | /** | 53 | /** |
| 54 | * Web server | 54 | * Web server |
| 55 | * | 55 | * |
| @@ -58,7 +58,7 @@ class windowsOpenOffice extends windowsService { | @@ -58,7 +58,7 @@ class windowsOpenOffice extends windowsService { | ||
| 58 | * @var string | 58 | * @var string |
| 59 | */ | 59 | */ |
| 60 | private $host; | 60 | private $host; |
| 61 | - | 61 | + |
| 62 | /** | 62 | /** |
| 63 | * Path to temp pid file | 63 | * Path to temp pid file |
| 64 | * | 64 | * |
| @@ -67,7 +67,7 @@ class windowsOpenOffice extends windowsService { | @@ -67,7 +67,7 @@ class windowsOpenOffice extends windowsService { | ||
| 67 | * @var string | 67 | * @var string |
| 68 | */ | 68 | */ |
| 69 | private $pidFile; | 69 | private $pidFile; |
| 70 | - | 70 | + |
| 71 | /** | 71 | /** |
| 72 | * Web server Port | 72 | * Web server Port |
| 73 | * | 73 | * |
| @@ -76,7 +76,7 @@ class windowsOpenOffice extends windowsService { | @@ -76,7 +76,7 @@ class windowsOpenOffice extends windowsService { | ||
| 76 | * @var string | 76 | * @var string |
| 77 | */ | 77 | */ |
| 78 | private $port; | 78 | private $port; |
| 79 | - | 79 | + |
| 80 | /** | 80 | /** |
| 81 | * Web server | 81 | * Web server |
| 82 | * | 82 | * |
| @@ -85,7 +85,7 @@ class windowsOpenOffice extends windowsService { | @@ -85,7 +85,7 @@ class windowsOpenOffice extends windowsService { | ||
| 85 | * @var string | 85 | * @var string |
| 86 | */ | 86 | */ |
| 87 | private $bin; | 87 | private $bin; |
| 88 | - | 88 | + |
| 89 | /** | 89 | /** |
| 90 | * Office executable name | 90 | * Office executable name |
| 91 | * | 91 | * |
| @@ -103,7 +103,7 @@ class windowsOpenOffice extends windowsService { | @@ -103,7 +103,7 @@ class windowsOpenOffice extends windowsService { | ||
| 103 | * @var string | 103 | * @var string |
| 104 | */ | 104 | */ |
| 105 | private $log; | 105 | private $log; |
| 106 | - | 106 | + |
| 107 | /** | 107 | /** |
| 108 | * Open office options | 108 | * Open office options |
| 109 | * | 109 | * |
| @@ -112,7 +112,7 @@ class windowsOpenOffice extends windowsService { | @@ -112,7 +112,7 @@ class windowsOpenOffice extends windowsService { | ||
| 112 | * @var string | 112 | * @var string |
| 113 | */ | 113 | */ |
| 114 | private $options; | 114 | private $options; |
| 115 | - | 115 | + |
| 116 | /** | 116 | /** |
| 117 | * Path to win service | 117 | * Path to win service |
| 118 | * | 118 | * |
| @@ -129,9 +129,9 @@ class windowsOpenOffice extends windowsService { | @@ -129,9 +129,9 @@ class windowsOpenOffice 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 = "KTOpenOffice"; | 133 | public $name = "KTOpenOffice"; |
| 134 | - | 134 | + |
| 135 | /** | 135 | /** |
| 136 | * Load defaults needed by service | 136 | * Load defaults needed by service |
| 137 | * | 137 | * |
| @@ -153,35 +153,35 @@ class windowsOpenOffice extends windowsService { | @@ -153,35 +153,35 @@ class windowsOpenOffice extends windowsService { | ||
| 153 | private function setPort($port = "8100") { | 153 | private function setPort($port = "8100") { |
| 154 | $this->port = $port; | 154 | $this->port = $port; |
| 155 | } | 155 | } |
| 156 | - | 156 | + |
| 157 | public function getPort() { | 157 | public function getPort() { |
| 158 | return $this->port; | 158 | return $this->port; |
| 159 | } | 159 | } |
| 160 | - | 160 | + |
| 161 | private function setHost($host = "127.0.0.1") { | 161 | private function setHost($host = "127.0.0.1") { |
| 162 | $this->host = $host; | 162 | $this->host = $host; |
| 163 | } | 163 | } |
| 164 | - | 164 | + |
| 165 | public function getHost() { | 165 | public function getHost() { |
| 166 | return $this->host; | 166 | return $this->host; |
| 167 | } | 167 | } |
| 168 | - | 168 | + |
| 169 | private function setLog($log = "openoffice.log") { | 169 | private function setLog($log = "openoffice.log") { |
| 170 | $this->log = $log; | 170 | $this->log = $log; |
| 171 | } | 171 | } |
| 172 | - | 172 | + |
| 173 | public function getLog() { | 173 | public function getLog() { |
| 174 | return $this->log; | 174 | return $this->log; |
| 175 | } | 175 | } |
| 176 | - | 176 | + |
| 177 | private function setBin($bin) { | 177 | private function setBin($bin) { |
| 178 | $this->bin = $bin; | 178 | $this->bin = $bin; |
| 179 | } | 179 | } |
| 180 | - | 180 | + |
| 181 | public function getBin() { | 181 | public function getBin() { |
| 182 | return $this->bin; | 182 | return $this->bin; |
| 183 | } | 183 | } |
| 184 | - | 184 | + |
| 185 | private function setWinservice($winservice = "winserv.exe") { | 185 | private function setWinservice($winservice = "winserv.exe") { |
| 186 | if(file_exists(SYS_BIN_DIR . $winservice)) { | 186 | if(file_exists(SYS_BIN_DIR . $winservice)) { |
| 187 | $this->winservice = SYS_BIN_DIR . $winservice; | 187 | $this->winservice = SYS_BIN_DIR . $winservice; |
| @@ -189,22 +189,22 @@ class windowsOpenOffice extends windowsService { | @@ -189,22 +189,22 @@ class windowsOpenOffice extends windowsService { | ||
| 189 | $this->winservice = SYS_BIN_DIR . "win32" . DS. $winservice; | 189 | $this->winservice = SYS_BIN_DIR . "win32" . DS. $winservice; |
| 190 | } | 190 | } |
| 191 | } | 191 | } |
| 192 | - | 192 | + |
| 193 | public function getWinservice() { | 193 | public function getWinservice() { |
| 194 | return $this->winservice; | 194 | return $this->winservice; |
| 195 | } | 195 | } |
| 196 | - | 196 | + |
| 197 | public function getOption() { | 197 | public function getOption() { |
| 198 | return $this->options; | 198 | return $this->options; |
| 199 | } | 199 | } |
| 200 | - | 200 | + |
| 201 | private function writeOfficeInstall($cmd) { | 201 | private function writeOfficeInstall($cmd) { |
| 202 | $officeInstallFile = SYS_VAR_DIR."bin".DS."officeinstall.bat"; | 202 | $officeInstallFile = SYS_VAR_DIR."bin".DS."officeinstall.bat"; |
| 203 | $fp = fopen($officeInstallFile, "w+"); | 203 | $fp = fopen($officeInstallFile, "w+"); |
| 204 | fwrite($fp, $cmd); | 204 | fwrite($fp, $cmd); |
| 205 | fclose($fp); | 205 | fclose($fp); |
| 206 | } | 206 | } |
| 207 | - | 207 | + |
| 208 | public function install() { | 208 | public function install() { |
| 209 | $status = $this->status(); | 209 | $status = $this->status(); |
| 210 | if($status == '') { | 210 | if($status == '') { |
| @@ -217,7 +217,7 @@ class windowsOpenOffice extends windowsService { | @@ -217,7 +217,7 @@ class windowsOpenOffice extends windowsService { | ||
| 217 | } | 217 | } |
| 218 | $this->writeOfficeInstall($cmd); | 218 | $this->writeOfficeInstall($cmd); |
| 219 | //$response = $this->util->pexec($cmd); | 219 | //$response = $this->util->pexec($cmd); |
| 220 | - return $response; | 220 | +// return $response; |
| 221 | } | 221 | } |
| 222 | return $status; | 222 | return $status; |
| 223 | } | 223 | } |
| @@ -225,7 +225,7 @@ class windowsOpenOffice extends windowsService { | @@ -225,7 +225,7 @@ class windowsOpenOffice extends windowsService { | ||
| 225 | return $status; | 225 | return $status; |
| 226 | } | 226 | } |
| 227 | } | 227 | } |
| 228 | - | 228 | + |
| 229 | /** | 229 | /** |
| 230 | * Retrieve Status Service | 230 | * Retrieve Status Service |
| 231 | * | 231 | * |
| @@ -241,10 +241,10 @@ class windowsOpenOffice extends windowsService { | @@ -241,10 +241,10 @@ class windowsOpenOffice extends windowsService { | ||
| 241 | $state = preg_replace('/^STATE *\: *\d */', '', trim($response['out'][3])); // Status store in third key | 241 | $state = preg_replace('/^STATE *\: *\d */', '', trim($response['out'][3])); // Status store in third key |
| 242 | return $state; | 242 | return $state; |
| 243 | } | 243 | } |
| 244 | - | 244 | + |
| 245 | return ''; | 245 | return ''; |
| 246 | } | 246 | } |
| 247 | - | 247 | + |
| 248 | /** | 248 | /** |
| 249 | * Start Service | 249 | * Start Service |
| 250 | * | 250 | * |