HttpMethod.class.php

Go to the documentation of this file.
00001 <?php
00002 /***************************************************************************
00003  *   Copyright (C) 2007 by Anton E. Lebedevich                             *
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: HttpMethod.class.php 4687 2007-12-09 18:57:18Z voxus $ */
00012 
00016     final class HttpMethod extends Enumeration
00017     {
00018         const OPTIONS   = 1;
00019         const GET       = 2;
00020         const HEAD      = 3;
00021         const POST      = 4;
00022         const PUT       = 5;
00023         const DELETE    = 6;
00024         const TRACE     = 7;
00025         const CONNECT   = 8;
00026         
00027         protected $names = array(
00028             self::OPTIONS   => 'OPTIONS',
00029             self::GET       => 'GET',
00030             self::HEAD      => 'HEAD',
00031             self::POST      => 'POST',
00032             self::PUT       => 'PUT',
00033             self::DELETE    => 'DELETE',
00034             self::TRACE     => 'TRACE',
00035             self::CONNECT   => 'CONNECT'
00036         );
00037         
00038         public static function get()
00039         {
00040             return new self(self::GET);
00041         }
00042         
00043         public static function post()
00044         {
00045             return new self(self::POST);
00046         }
00047     }
00048 ?>

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