MediaWiki  REL1_24
HttpStatus.php
Go to the documentation of this file.
00001 <?php
00026 class HttpStatus {
00027 
00035     public static function getMessage( $code ) {
00036         static $statusMessage = array(
00037             100 => 'Continue',
00038             101 => 'Switching Protocols',
00039             102 => 'Processing',
00040             200 => 'OK',
00041             201 => 'Created',
00042             202 => 'Accepted',
00043             203 => 'Non-Authoritative Information',
00044             204 => 'No Content',
00045             205 => 'Reset Content',
00046             206 => 'Partial Content',
00047             207 => 'Multi-Status',
00048             300 => 'Multiple Choices',
00049             301 => 'Moved Permanently',
00050             302 => 'Found',
00051             303 => 'See Other',
00052             304 => 'Not Modified',
00053             305 => 'Use Proxy',
00054             307 => 'Temporary Redirect',
00055             400 => 'Bad Request',
00056             401 => 'Unauthorized',
00057             402 => 'Payment Required',
00058             403 => 'Forbidden',
00059             404 => 'Not Found',
00060             405 => 'Method Not Allowed',
00061             406 => 'Not Acceptable',
00062             407 => 'Proxy Authentication Required',
00063             408 => 'Request Timeout',
00064             409 => 'Conflict',
00065             410 => 'Gone',
00066             411 => 'Length Required',
00067             412 => 'Precondition Failed',
00068             413 => 'Request Entity Too Large',
00069             414 => 'Request-URI Too Large',
00070             415 => 'Unsupported Media Type',
00071             416 => 'Request Range Not Satisfiable',
00072             417 => 'Expectation Failed',
00073             422 => 'Unprocessable Entity',
00074             423 => 'Locked',
00075             424 => 'Failed Dependency',
00076             428 => 'Precondition Required',
00077             429 => 'Too Many Requests',
00078             431 => 'Request Header Fields Too Large',
00079             500 => 'Internal Server Error',
00080             501 => 'Not Implemented',
00081             502 => 'Bad Gateway',
00082             503 => 'Service Unavailable',
00083             504 => 'Gateway Timeout',
00084             505 => 'HTTP Version Not Supported',
00085             507 => 'Insufficient Storage',
00086             511 => 'Network Authentication Required',
00087         );
00088         return isset( $statusMessage[$code] ) ? $statusMessage[$code] : null;
00089     }
00090 
00091 }