| 1 | <?php |
||
| 16 | class LiteSpeedProxy extends AbstractProxy |
||
| 17 | { |
||
| 18 | protected $binary = '/usr/local/lsws/bin/lswsctrl'; |
||
| 19 | |||
| 20 | protected $port = 8080; |
||
| 21 | |||
| 22 | protected $cacheDir = 'cachedata'; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * {@inheritdoc} |
||
| 26 | */ |
||
| 27 | public function start() |
||
| 28 | { |
||
| 29 | /*$process = $this->runCommand([ |
||
| 30 | $this->getBinary(), |
||
| 31 | 'status', |
||
| 32 | ], true); |
||
| 33 | |||
| 34 | // Already running |
||
| 35 | if ('terminated' !== $process->getStatus()) { |
||
| 36 | return; |
||
| 37 | }*/ |
||
| 38 | |||
| 39 | $this->runCommand([ |
||
| 40 | $this->getBinary(), |
||
| 41 | 'start', |
||
| 42 | ], true); |
||
| 43 | |||
| 44 | $this->waitFor($this->getIp(), $this->getPort(), 2000); |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * {@inheritdoc} |
||
| 49 | */ |
||
| 50 | public function stop() |
||
| 51 | { |
||
| 52 | /*$process = $this->runCommand([ |
||
| 53 | $this->getBinary(), |
||
| 54 | 'status', |
||
| 55 | ], true); |
||
| 56 | |||
| 57 | // Already stopped |
||
| 58 | if ('terminated' === $process->getStatus()) { |
||
| 59 | return; |
||
| 60 | }*/ |
||
| 61 | |||
| 62 | $this->runCommand([ |
||
| 63 | $this->getBinary(), |
||
| 64 | 'stop', |
||
| 65 | ], true); |
||
| 66 | } |
||
| 67 | |||
| 68 | /** |
||
| 69 | * {@inheritdoc} |
||
| 70 | */ |
||
| 71 | public function clear() |
||
| 86 | |||
| 87 | /** |
||
| 88 | * @param string $cacheDir |
||
| 89 | */ |
||
| 90 | public function setCacheDir($cacheDir) |
||
| 94 | |||
| 95 | /** |
||
| 96 | * @return string |
||
| 97 | */ |
||
| 98 | public function getCacheDir() |
||
| 102 | } |
||
| 103 |