8 * Get the message associed with the HTTP response code $code
10 * Replace OutputPage::getStatusMessage( $code )
12 * @param $code Integer: status code
13 * @return String or null: message or null if $code is not in the list of
16 public static function getMessage( $code ) {
17 static $statusMessage = array(
19 101 => 'Switching Protocols',
24 203 => 'Non-Authoritative Information',
26 205 => 'Reset Content',
27 206 => 'Partial Content',
28 207 => 'Multi-Status',
29 300 => 'Multiple Choices',
30 301 => 'Moved Permanently',
33 304 => 'Not Modified',
35 307 => 'Temporary Redirect',
37 401 => 'Unauthorized',
38 402 => 'Payment Required',
41 405 => 'Method Not Allowed',
42 406 => 'Not Acceptable',
43 407 => 'Proxy Authentication Required',
44 408 => 'Request Timeout',
47 411 => 'Length Required',
48 412 => 'Precondition Failed',
49 413 => 'Request Entity Too Large',
50 414 => 'Request-URI Too Large',
51 415 => 'Unsupported Media Type',
52 416 => 'Request Range Not Satisfiable',
53 417 => 'Expectation Failed',
54 422 => 'Unprocessable Entity',
56 424 => 'Failed Dependency',
57 500 => 'Internal Server Error',
58 501 => 'Not Implemented',
60 503 => 'Service Unavailable',
61 504 => 'Gateway Timeout',
62 505 => 'HTTP Version Not Supported',
63 507 => 'Insufficient Storage'
65 return isset( $statusMessage[$code] ) ?
$statusMessage[$code] : null;