1 | <?php |
||
16 | abstract class ResponseStatus |
||
17 | { |
||
18 | /** |
||
19 | * Name and revision of the information protocol |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | public static $protocol; |
||
24 | |||
25 | /** |
||
26 | * @param string $protocol |
||
27 | */ |
||
28 | public static function setup($protocol) |
||
32 | |||
33 | /** |
||
34 | * @param int $code HTTP response code |
||
35 | * @param string $status The header string which will be used to figure out the HTTP status code to send. |
||
36 | * @param bool $replace Whether the header should replace a previous similar header. |
||
37 | */ |
||
38 | public static function send($code, $status, $replace = true) |
||
42 | |||
43 | public static function sendXFrameDeny() |
||
47 | |||
48 | public static function sendXFrameSameOrigin() |
||
52 | |||
53 | public static function sendContinue() |
||
57 | |||
58 | public static function sendProcessing() |
||
62 | |||
63 | public static function sendOK() |
||
67 | |||
68 | public static function sendCreated() |
||
72 | |||
73 | public static function sendAccepted() |
||
77 | |||
78 | public static function sendNoAuthInfo() |
||
82 | |||
83 | public static function sendNoContent() |
||
87 | |||
88 | public static function sendMovedPermanently() |
||
92 | |||
93 | public static function sendFound() |
||
97 | |||
98 | public static function sendNotModified() |
||
102 | |||
103 | public static function sendTemporaryRedirect() |
||
107 | |||
108 | public static function sendBadRequest() |
||
112 | |||
113 | public static function sendUnauthorized() |
||
117 | |||
118 | public static function sendPaymentRequired() |
||
122 | |||
123 | public static function sendForbidden() |
||
127 | |||
128 | public static function sendNotFound() |
||
129 | { |
||
130 | self::send(404, 'Not Found'); |
||
131 | } |
||
132 | |||
133 | public static function sendMethodNotAllowed() |
||
137 | |||
138 | public static function sendNotAcceptable() |
||
142 | |||
143 | public static function sendProxyAuthRequired() |
||
147 | |||
148 | public static function sendRequestTimeout() |
||
152 | |||
153 | public static function sendConflict() |
||
154 | { |
||
155 | self::send(409, 'Conflict'); |
||
156 | } |
||
157 | |||
158 | public static function sendUnsupportedMediaType() |
||
162 | |||
163 | public static function sendLocked() |
||
167 | |||
168 | public static function sendServiceUnavailable() |
||
172 | } |
||
173 |