HttpStatus.class.php

Go to the documentation of this file.
00001 <?php
00002 /***************************************************************************
00003  *   Copyright (C) 2006-2007 by Dmitry E. Demidov                          *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU Lesser General Public License as        *
00007  *   published by the Free Software Foundation; either version 3 of the    *
00008  *   License, or (at your option) any later version.                       *
00009  *                                                                         *
00010  ***************************************************************************/
00011 /* $Id: HttpStatus.class.php 4687 2007-12-09 18:57:18Z voxus $ */
00012 
00018     final class HttpStatus extends Enumeration
00019     {
00020         const CODE_100  = 100;
00021         const CODE_101  = 101;
00022         const CODE_200  = 200;
00023         const CODE_201  = 201;
00024         const CODE_202  = 202;
00025         const CODE_203  = 203;
00026         const CODE_204  = 204;
00027         const CODE_205  = 205;
00028         const CODE_206  = 206;
00029         const CODE_300  = 300;
00030         const CODE_301  = 301;
00031         const CODE_302  = 302;
00032         const CODE_303  = 303;
00033         const CODE_304  = 304;
00034         const CODE_305  = 305;
00035         const CODE_307  = 307;
00036         const CODE_400  = 400;
00037         const CODE_401  = 401;
00038         const CODE_402  = 402;
00039         const CODE_403  = 403;
00040         const CODE_404  = 404;
00041         const CODE_405  = 405;
00042         const CODE_406  = 406;
00043         const CODE_407  = 407;
00044         const CODE_408  = 408;
00045         const CODE_409  = 409;
00046         const CODE_410  = 410;
00047         const CODE_411  = 411;
00048         const CODE_412  = 412;
00049         const CODE_413  = 413;
00050         const CODE_414  = 414;
00051         const CODE_415  = 415;
00052         const CODE_416  = 416;
00053         const CODE_417  = 417;
00054         const CODE_500  = 500;
00055         const CODE_501  = 501;
00056         const CODE_502  = 502;
00057         const CODE_503  = 503;
00058         const CODE_504  = 504;
00059         const CODE_507  = 507;
00060         const CODE_510  = 510;
00061         
00062         protected $names = array(
00063             self::CODE_100 => 'Continue',
00064             self::CODE_101 => 'Switching Protocols',
00065             self::CODE_200 => 'OK',
00066             self::CODE_201 => 'Created',
00067             self::CODE_202 => 'Accepted',
00068             self::CODE_203 => 'Non-Authoritative Information',
00069             self::CODE_204 => 'No Content',
00070             self::CODE_205 => 'Reset Content',
00071             self::CODE_206 => 'Partial Content',
00072             self::CODE_300 => 'Multiple Choices',
00073             self::CODE_301 => 'Moved Permanently',
00074             self::CODE_302 => 'Found',
00075             self::CODE_303 => 'See Other',
00076             self::CODE_304 => 'Not Modified',
00077             self::CODE_305 => 'Use Proxy',
00078             self::CODE_307 => 'Temporary Redirect',
00079             self::CODE_400 => 'Bad Request',
00080             self::CODE_401 => 'Unauthorized',
00081             self::CODE_402 => 'Payment Required',
00082             self::CODE_403 => 'Forbidden',
00083             self::CODE_404 => 'Not Found',
00084             self::CODE_405 => 'Method Not Allowed',
00085             self::CODE_406 => 'Not Acceptable',
00086             self::CODE_407 => 'Proxy Authentication Required',
00087             self::CODE_408 => 'Request Time-out',
00088             self::CODE_409 => 'Conflict',
00089             self::CODE_410 => 'Gone',
00090             self::CODE_411 => 'Length Required',
00091             self::CODE_412 => 'Precondition Failed',
00092             self::CODE_413 => 'Request Entity Too Large',
00093             self::CODE_414 => 'Request-URI Too Large',
00094             self::CODE_415 => 'Unsupported Media Type',
00095             self::CODE_416 => 'Requested range not satisfiable',
00096             self::CODE_417 => 'Expectation Failed',
00097             self::CODE_500 => 'Internal Server Error',
00098             self::CODE_501 => 'Not Implemented',
00099             self::CODE_502 => 'Bad Gateway',
00100             self::CODE_503 => 'Service Unavailable',
00101             self::CODE_504 => 'Gateway Time-out',
00102             self::CODE_507 => 'Insufficient Storage',
00103             self::CODE_510 => 'Not Extended'
00104         );
00105         
00106         public static function getAnyId()
00107         {
00108             return 200;
00109         }
00110         
00111         public function toString()
00112         {
00113             return 'HTTP/1.1 '.$this->id.' '.$this->name;
00114         }
00115     }
00116 ?>

Generated on Sun Dec 9 21:56:24 2007 for onPHP by  doxygen 1.5.4