1 | <?php |
||
13 | class CommandState { |
||
14 | |||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | protected $pidFile; |
||
19 | |||
20 | |||
21 | /** |
||
22 | * Unique file name pid file name. |
||
23 | * |
||
24 | * @param Command $command |
||
25 | * @param null|string $tmpDirectory |
||
26 | */ |
||
27 | public function __construct(Command $command, $tmpDirectory = null) { |
||
39 | |||
40 | |||
41 | /** |
||
42 | * @return bool |
||
43 | * @throws \Exception |
||
44 | */ |
||
45 | public function isAlive() { |
||
57 | |||
58 | |||
59 | /** |
||
60 | * @param $pid |
||
61 | * @return $this |
||
62 | */ |
||
63 | public function setPid($pid) { |
||
72 | |||
73 | |||
74 | /** |
||
75 | * @return null|int |
||
76 | * @throws \Exception |
||
77 | */ |
||
78 | public function getPid() { |
||
96 | |||
97 | |||
98 | /** |
||
99 | * Remove pid file |
||
100 | * |
||
101 | * @return bool |
||
102 | */ |
||
103 | public function unlink() { |
||
109 | |||
110 | |||
111 | /** |
||
112 | * @return string |
||
113 | */ |
||
114 | public function getPidFilePath() { |
||
117 | |||
118 | } |
||
119 |