1 | <?php |
||
9 | class Config |
||
10 | { |
||
11 | /** |
||
12 | * Array of shell jobs. |
||
13 | * |
||
14 | * @var array |
||
15 | */ |
||
16 | protected $jobs = []; |
||
17 | |||
18 | /** |
||
19 | * PHP executable path for using shell jobs. Defaults 'php'. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $phpPath = 'php'; |
||
24 | |||
25 | /** |
||
26 | * Base path for script. Defaults 'getcwd()/public/'. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $scriptPath = null; |
||
31 | |||
32 | /** |
||
33 | * Timeout in seconds for the process. null for no timeout. |
||
34 | * |
||
35 | * @var int |
||
36 | */ |
||
37 | protected $timeout = null; |
||
38 | |||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | protected $logDirectory; |
||
43 | |||
44 | /** |
||
45 | * @var FileSystem |
||
46 | */ |
||
47 | protected $fileSystem; |
||
48 | |||
49 | /** |
||
50 | * Config constructor. |
||
51 | * |
||
52 | * @param array $config |
||
53 | * @param FileSystem|null $filesystem |
||
54 | */ |
||
55 | public function __construct(array $config = [], FileSystem $filesystem = null) |
||
86 | |||
87 | private function prepareLogDirectory($logDirectory) |
||
101 | |||
102 | /** |
||
103 | * @return string |
||
104 | */ |
||
105 | public function getLogDirectory() |
||
109 | |||
110 | /** |
||
111 | * @return array |
||
112 | */ |
||
113 | public function getJobs() |
||
117 | |||
118 | /** |
||
119 | * @param $key |
||
120 | * @return array |
||
121 | */ |
||
122 | public function getJob($key) |
||
126 | |||
127 | /** |
||
128 | * @return boolean |
||
129 | */ |
||
130 | public function hasJobs() |
||
134 | |||
135 | /** |
||
136 | * @return string |
||
137 | */ |
||
138 | public function getPhpPath() |
||
142 | |||
143 | /** |
||
144 | * @return string |
||
145 | */ |
||
146 | public function getScriptPath() |
||
153 | |||
154 | /** |
||
155 | * @return int |
||
156 | */ |
||
157 | public function getTimeout() |
||
161 | } |
||
162 |