Maileon PHP client  1.2.5
Easily integrate your PHP application with Maileon.
HTTPResponseCodes.php
1 <?php
2 
10 {
11 
12 
16  const OK = 200;
17 
21  const CREATED = 201;
22 
26  const ACCEPTED = 202;
27 
31  const NO_CONTENT = 204;
32 
36  const MOVED_PERMANENTLY = 301;
37 
41  const SEE_OTHER = 303;
42 
46  const NOT_MODIFIED = 304;
47 
51  const TEMPORARY_REDIRECT = 307;
52 
56  const BAD_REQUEST = 400;
57 
61  const UNAUTHORIZED = 401;
62 
66  const FORBIDDEN = 403;
67 
71  const NOT_FOUND = 404;
72 
76  const NOT_ACCEPTABLE = 406;
77 
81  const CONFLICT = 409;
82 
86  const GONE = 410;
87 
91  const PRECONDITION_FAILED = 412;
92 
97 
102 
106  const SERVICE_UNAVAILABLE = 503;
107 
108  protected static $codes = array(
109  200 => "OK",
110  201 => "Created",
111  202 => "Accepted",
112  204 => "No Content",
113  301 => "Moved Permanently",
114  303 => "See Other",
115  304 => "Not Modified",
116  307 => "Temporary Redirect",
117  400 => "Bad Request",
118  401 => "Unauthorized",
119  403 => "Forbidden",
120  404 => "Not Found",
121  406 => "Not Acceptable",
122  409 => "Conflict",
123  410 => "Gone",
124  412 => "Precondition Failed",
125  415 => "Unsupported Media Type",
126  500 => "Internal Server Error",
127  503 => "Service Unavailable"
128  );
129 
138  static function getStringFromHTTPStatusCode($httpStatusCode)
139  {
140  if (array_key_exists($httpStatusCode, com_maileon_api_HTTPResponseCodes::$codes) === true) {
141  return com_maileon_api_HTTPResponseCodes::$codes[$httpStatusCode];
142  } else return "unknown error code: " . $httpStatusCode;
143  }
144 
145 
146 }
static getStringFromHTTPStatusCode($httpStatusCode)