| Total Complexity | 12 |
| Total Lines | 59 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 4 | final class Runner implements \WebServCo\Framework\Interfaces\CliRunnerInterface |
||
| 5 | { |
||
| 6 | protected $pid; |
||
| 7 | protected $statistics; |
||
| 8 | protected $workDir; |
||
| 9 | |||
| 10 | public function __construct($workDir) |
||
| 11 | { |
||
| 12 | if (!is_readable($workDir)) { |
||
| 13 | throw new \WebServCo\Framework\Exceptions\ApplicationException('Working directory not readable'); |
||
| 14 | } |
||
| 15 | |||
| 16 | $this->statistics = new Statistics(); |
||
| 17 | $this->workDir = $workDir; |
||
| 18 | } |
||
| 19 | |||
| 20 | public function finish() |
||
| 29 | } |
||
| 30 | |||
| 31 | public function getPid() |
||
| 32 | { |
||
| 33 | if (!$this->isRunning()) { |
||
| 34 | return false; |
||
| 35 | } |
||
| 36 | return $this->pid; |
||
| 37 | } |
||
| 38 | |||
| 39 | public function getStatistics() |
||
| 42 | } |
||
| 43 | |||
| 44 | public function isRunning() |
||
| 45 | { |
||
| 46 | if (empty($this->pid)) { |
||
| 47 | return false; |
||
| 48 | } |
||
| 49 | return is_readable($this->pid); |
||
| 50 | } |
||
| 51 | |||
| 52 | public function start() |
||
| 63 | } |
||
| 64 | } |
||
| 65 |