1 | <?php |
||
8 | class Status |
||
9 | { |
||
10 | protected $status; |
||
11 | |||
12 | protected $isExited = false; |
||
13 | |||
14 | /** |
||
15 | * exit code |
||
16 | * @var int |
||
17 | */ |
||
18 | protected $exitCode; |
||
19 | |||
20 | /** |
||
21 | * error message |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $errorMessage; |
||
25 | |||
26 | /** |
||
27 | * If the signal that caused the process to terminate |
||
28 | * @var boolean |
||
29 | */ |
||
30 | protected $isSignaled = false; |
||
31 | |||
32 | /** |
||
33 | * The signal that caused the process to terminate |
||
34 | * @var int |
||
35 | */ |
||
36 | protected $terminateSignal; |
||
37 | |||
38 | /** |
||
39 | * The process If stopped |
||
40 | * @var bool |
||
41 | */ |
||
42 | protected $isStopped = false; |
||
43 | |||
44 | /** |
||
45 | * The signal that caused the process to stop |
||
46 | * @var int |
||
47 | */ |
||
48 | protected $stopSignal; |
||
49 | |||
50 | public function __construct($status) |
||
66 | |||
67 | /** |
||
68 | * Checks if status code represents a normal exit. |
||
69 | * @return bool |
||
70 | */ |
||
71 | public function isExited() |
||
75 | |||
76 | /** |
||
77 | * Gets the exit code if the process is exited normally |
||
78 | * @return int |
||
79 | */ |
||
80 | public function getExitCode() |
||
84 | |||
85 | /** |
||
86 | * @return string |
||
87 | */ |
||
88 | public function getErrorMessage() |
||
92 | |||
93 | /** |
||
94 | * Check whether the process exits because of an signal |
||
95 | * return boolean |
||
96 | */ |
||
97 | public function isSignaled() |
||
101 | |||
102 | /** |
||
103 | * Gets the signal which caused the child to terminate. |
||
104 | * @return int |
||
105 | */ |
||
106 | public function getTerminateSignal() |
||
110 | |||
111 | /** |
||
112 | * Checks whether the child process is currently stopped. |
||
113 | * @return bool |
||
114 | */ |
||
115 | public function isStopped() |
||
119 | |||
120 | /** |
||
121 | * Gets the signal which caused the child to stop. |
||
122 | * @return int |
||
123 | */ |
||
124 | public function getStopSignal() |
||
128 | |||
129 | /** |
||
130 | * Checks whether the process is executed successfully |
||
131 | * @return bool |
||
132 | */ |
||
133 | public function isSuccessful() |
||
137 | } |
||
138 |