1 | <?php |
||
7 | class ServerConfig |
||
8 | { |
||
9 | /** |
||
10 | * @var int |
||
11 | */ |
||
12 | private $clientsPerFork = WebSocketServerContract::CLIENTS_PER_FORK; |
||
13 | |||
14 | /** |
||
15 | * @var int |
||
16 | */ |
||
17 | private $streamSelectTimeout = WebSocketServerContract::STREAM_SELECT_TIMEOUT; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | private $host = WebSocketServerContract::DEFAULT_HOST; |
||
23 | |||
24 | /** |
||
25 | * @var int |
||
26 | */ |
||
27 | private $port = WebSocketServerContract::DEFAULT_PORT; |
||
28 | |||
29 | /** |
||
30 | * @var bool |
||
31 | */ |
||
32 | private $isForking = true; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | private $processName = WebSocketServerContract::PROC_TITLE; |
||
38 | |||
39 | /** |
||
40 | * @var bool |
||
41 | */ |
||
42 | private $checkOrigin = false; |
||
43 | |||
44 | /** |
||
45 | * @var array |
||
46 | */ |
||
47 | private $origins = []; |
||
48 | |||
49 | |||
50 | /** |
||
51 | * @var bool |
||
52 | */ |
||
53 | private $originHeader = false; |
||
54 | |||
55 | /** |
||
56 | * @var bool |
||
57 | */ |
||
58 | private $isSsl = false; |
||
59 | |||
60 | /** |
||
61 | * @var string |
||
62 | */ |
||
63 | private $localCert; |
||
64 | |||
65 | /** |
||
66 | * @var string |
||
67 | */ |
||
68 | private $localPk; |
||
69 | |||
70 | /** |
||
71 | * @var bool |
||
72 | */ |
||
73 | private $allowSelfSigned; |
||
74 | |||
75 | /** |
||
76 | * @var int |
||
77 | */ |
||
78 | private $cryptoType; |
||
79 | |||
80 | /** |
||
81 | * @return mixed |
||
82 | */ |
||
83 | public function getClientsPerFork(): int |
||
87 | |||
88 | /** |
||
89 | * @param mixed $clientsPerFork |
||
90 | * @return ServerConfig |
||
91 | */ |
||
92 | public function setClientsPerFork(int $clientsPerFork): ServerConfig |
||
97 | |||
98 | /** |
||
99 | * @return mixed |
||
100 | */ |
||
101 | public function getStreamSelectTimeout(): int |
||
105 | |||
106 | /** |
||
107 | * @param mixed $streamSelectTimeout |
||
108 | * @return ServerConfig |
||
109 | */ |
||
110 | public function setStreamSelectTimeout(int $streamSelectTimeout): ServerConfig |
||
115 | |||
116 | /** |
||
117 | * @return string |
||
118 | */ |
||
119 | public function getHost(): string |
||
123 | |||
124 | /** |
||
125 | * @param string $host |
||
126 | * @return ServerConfig |
||
127 | */ |
||
128 | public function setHost(string $host): ServerConfig |
||
133 | |||
134 | /** |
||
135 | * @return int |
||
136 | */ |
||
137 | public function getPort(): int |
||
141 | |||
142 | /** |
||
143 | * @param int $port |
||
144 | * @return ServerConfig |
||
145 | */ |
||
146 | public function setPort(int $port): ServerConfig |
||
151 | |||
152 | /** |
||
153 | * @return bool |
||
154 | */ |
||
155 | public function isForking(): bool |
||
159 | |||
160 | /** |
||
161 | * @param bool $isForking |
||
162 | */ |
||
163 | public function setForking(bool $isForking): ServerConfig |
||
168 | |||
169 | /** |
||
170 | * @return string |
||
171 | */ |
||
172 | public function getProcessName(): string |
||
176 | |||
177 | /** |
||
178 | * @param string $processName |
||
179 | */ |
||
180 | public function setProcessName(string $processName): ServerConfig |
||
185 | |||
186 | /** |
||
187 | * @return bool |
||
188 | */ |
||
189 | public function isCheckOrigin(): bool |
||
193 | |||
194 | /** |
||
195 | * @param bool $checkOrigin |
||
196 | * @return ServerConfig |
||
197 | */ |
||
198 | public function setCheckOrigin(bool $checkOrigin): ServerConfig |
||
203 | |||
204 | /** |
||
205 | * @return array |
||
206 | */ |
||
207 | public function getOrigins(): array |
||
211 | |||
212 | /** |
||
213 | * @param array $origins |
||
214 | * @return ServerConfig |
||
215 | */ |
||
216 | public function setOrigins(array $origins): ServerConfig |
||
224 | |||
225 | /** |
||
226 | * @return bool |
||
227 | */ |
||
228 | public function isOriginHeader(): bool |
||
232 | |||
233 | /** |
||
234 | * @param bool $originHeader |
||
235 | * @return ServerConfig |
||
236 | */ |
||
237 | public function setOriginHeader(bool $originHeader): ServerConfig |
||
242 | |||
243 | /** |
||
244 | * @param bool $isSsl |
||
245 | * @return ServerConfig |
||
246 | */ |
||
247 | public function setIsSsl(bool $isSsl): ServerConfig |
||
252 | |||
253 | /** |
||
254 | * @return bool |
||
255 | */ |
||
256 | public function isSsl(): bool |
||
260 | |||
261 | /** |
||
262 | * @param mixed $localCert |
||
263 | * @return ServerConfig |
||
264 | */ |
||
265 | public function setLocalCert(string $localCert): ServerConfig |
||
270 | |||
271 | /** |
||
272 | * @return mixed |
||
273 | */ |
||
274 | public function getLocalCert(): string |
||
278 | |||
279 | /** |
||
280 | * @param mixed $localPk |
||
281 | * @return ServerConfig |
||
282 | */ |
||
283 | public function setLocalPk(string $localPk): ServerConfig |
||
288 | |||
289 | /** |
||
290 | * @return mixed |
||
291 | */ |
||
292 | public function getLocalPk(): string |
||
296 | |||
297 | /** |
||
298 | * @param bool $allowSelfSigned |
||
299 | * @return ServerConfig |
||
300 | */ |
||
301 | public function setAllowSelfSigned(bool $allowSelfSigned): ServerConfig |
||
306 | |||
307 | /** |
||
308 | * @return bool |
||
309 | */ |
||
310 | public function getAllowSelfSigned(): bool |
||
314 | |||
315 | /** |
||
316 | * @param int $cryptoType |
||
317 | * @return ServerConfig |
||
318 | */ |
||
319 | public function setCryptoType(int $cryptoType): ServerConfig |
||
324 | |||
325 | /** |
||
326 | * @return mixed |
||
327 | */ |
||
328 | public function getCryptoType(): int |
||
332 | } |