constants.lib.php File Reference

This files defines some common constants and some helper functions. More...

Go to the source code of this file.

Enumerations

enum  NL
 < Newline character
enum  LF
 < Newline character
enum  CR
 < Carriage return character
enum  CRLF
 < Carriage return character followed by newline character
enum  DTD_XHTML_1_0_STRICT
 Document Type Definition for XHTML 1.0 Strict.
enum  DTD_XHTML_1_0_TRANSITIONAL
 Document Type Definition for XHTML 1.0 Transitional.
enum  DTD_XHTML_1_0_FRAMESET
 Document Type Definition for XHTML 1.0 Frameset.
enum  HTTP_STATUS_200
 HTTP Status OK.
enum  HTTP_STATUS_OK
 HTTP Status OK.
enum  HTTP_STATUS_301
 HTTP Status Moved.
enum  HTTP_STATUS_MOVED_PERMANENTLY
 HTTP Status Moved.
enum  HTTP_STATUS_MOVED
 HTTP Status Moved.
enum  HTTP_STATUS_302
 HTTP Status Found.
enum  HTTP_STATUS_FOUND
 HTTP Status Found.
enum  HTTP_STATUS_304
 HTTP Status Not Modified.
enum  HTTP_STATUS_NOT_MODIFIED
 HTTP Status Not Modified.
enum  HTTP_STATUS_401
 HTTP Status Unauthorized.
enum  HTTP_STATUS_UNAUTHORIZED
 HTTP Status Unauthorized.
enum  HTTP_STATUS_403
 HTTP Status Forbidden.
enum  HTTP_STATUS_FORBIDDEN
 HTTP Status Forbidden.
enum  HTTP_STATUS_404
 HTTP Status Not Found.
enum  HTTP_STATUS_NOT_FOUND
 HTTP Status Not Found.
enum  HTTP_STATUS_500
 HTTP Status Internal Server Error.
enum  HTTP_STATUS_INTERNAL_SERVER_ERROR
 HTTP Status Internal Server Error.
enum  HTTP_STATUS_SERVER_ERROR
 HTTP Status Internal Server Error.
enum  HTTP_STATUS_501
 HTTP Status Not Implemented.
enum  HTTP_STATUS_NOT_IMPLEMENTED
 HTTP Status Not Implemented.

Functions

 http_status_to_string ($http_status)
 Convert HTTP error code into a string.
 mkenum ($items)
 Creates an enumeration of constants.

Variables

global $__anewt_http_status_strings
 HTTP status code to string mapping.


Detailed Description

This files defines some common constants and some helper functions.

Definition in file constants.lib.php.


Function Documentation

http_status_to_string ( http_status  ) 

Convert HTTP error code into a string.

Returns the appropriate human readable status string for the given status code as per rfc2616.

Parameters:
$http_status The HTTP status ok, e.g. 200
Returns:
A string with the status code

Definition at line 119 of file constants.lib.php.

mkenum ( items  ) 

Creates an enumeration of constants.

The strings supplied to this function will be defined as constants with a unique value.

Example: mkenum('TYPE_FIRST', 'TYPE_SECOND', 'TYPE_THIRD');

Note that multiple invokations of this function results in the same values being used again, but that's pointless anyway.

Parameters:
$items One or more strings (or a single array of strings)

Definition at line 138 of file constants.lib.php.


Variable Documentation

$__anewt_http_status_strings

Initial value:

 array(
        HTTP_STATUS_200 => 'OK',
        HTTP_STATUS_301 => 'Moved Permanently',
        HTTP_STATUS_302 => 'Found',
        HTTP_STATUS_401 => 'Unauthorized',
        HTTP_STATUS_403 => 'Forbidden',
        HTTP_STATUS_404 => 'Not Found',
        HTTP_STATUS_500 => 'Internal Server Error',
        HTTP_STATUS_501 => 'Not Implemented',
)
HTTP status code to string mapping.

Definition at line 90 of file constants.lib.php.


Generated on Sun Aug 2 22:54:37 2009 for Anewt by  doxygen 1.5.9