1 | <?php declare(strict_types=1); |
||
14 | class EndRequest extends Record |
||
15 | { |
||
16 | |||
17 | /** |
||
18 | * The appStatus component is an application-level status code. Each role documents its usage of appStatus. |
||
19 | * |
||
20 | * @var int |
||
21 | */ |
||
22 | protected $appStatus = 0; |
||
23 | |||
24 | /** |
||
25 | * The protocolStatus component is a protocol-level status code. |
||
26 | * |
||
27 | * The possible protocolStatus values are: |
||
28 | * FCGI_REQUEST_COMPLETE: normal end of request. |
||
29 | * FCGI_CANT_MPX_CONN: rejecting a new request. |
||
30 | * This happens when a Web server sends concurrent requests over one connection to an application that is |
||
31 | * designed to process one request at a time per connection. |
||
32 | * FCGI_OVERLOADED: rejecting a new request. |
||
33 | * This happens when the application runs out of some resource, e.g. database connections. |
||
34 | * FCGI_UNKNOWN_ROLE: rejecting a new request. |
||
35 | * This happens when the Web server has specified a role that is unknown to the application. |
||
36 | * |
||
37 | * @var int |
||
38 | */ |
||
39 | protected $protocolStatus = FCGI::REQUEST_COMPLETE; |
||
40 | |||
41 | /** |
||
42 | * Reserved data, 3 bytes maximum |
||
43 | * |
||
44 | * @var string |
||
45 | */ |
||
46 | protected $reserved1; |
||
47 | |||
48 | public function __construct(int $protocolStatus = FCGI::REQUEST_COMPLETE, int $appStatus = 0, string $reserved = '') |
||
56 | 2 | ||
57 | 2 | /** |
|
58 | * Returns app status |
||
59 | * |
||
60 | * The appStatus component is an application-level status code. Each role documents its usage of appStatus. |
||
61 | */ |
||
62 | public function getAppStatus(): int |
||
66 | 2 | ||
67 | /** |
||
68 | 2 | * Returns the protocol status |
|
69 | * |
||
70 | * The possible protocolStatus values are: |
||
71 | * FCGI_REQUEST_COMPLETE: normal end of request. |
||
72 | * FCGI_CANT_MPX_CONN: rejecting a new request. |
||
73 | * This happens when a Web server sends concurrent requests over one connection to an application that is |
||
74 | * designed to process one request at a time per connection. |
||
75 | * FCGI_OVERLOADED: rejecting a new request. |
||
76 | * This happens when the application runs out of some resource, e.g. database connections. |
||
77 | * FCGI_UNKNOWN_ROLE: rejecting a new request. |
||
78 | * This happens when the Web server has specified a role that is unknown to the application. |
||
79 | */ |
||
80 | public function getProtocolStatus(): int |
||
84 | |||
85 | /** |
||
86 | 2 | * {@inheritdoc} |
|
87 | * @param static $self |
||
88 | 2 | */ |
|
89 | protected static function unpackPayload($self, string $data): void |
||
97 | |||
98 | /** {@inheritdoc} */ |
||
99 | 1 | protected function packPayload(): string |
|
108 | |||
109 | } |
||
110 |