initial commit
This commit is contained in:
25
helpers/constants/cache_ttl.php
Normal file
25
helpers/constants/cache_ttl.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cache TTL (Time-To-Live)
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here is a collection of intervals in seconds that are commong to use
|
||||
| when caching, but written as a more human-friendly phrase.
|
||||
|
|
||||
*/
|
||||
|
||||
define('CACHE_TTL_FIVE_MINUTES', 300);
|
||||
define('CACHE_TTL_FIFTEEN_MINUTES', 900);
|
||||
|
||||
define('CACHE_TTL_HALF_HOUR', 1800);
|
||||
define('CACHE_TTL_ONE_HOUR', 3600);
|
||||
define('CACHE_TTL_TWO_HOURS', 7200);
|
||||
define('CACHE_TTL_THREE_HOURS', 10800);
|
||||
define('CACHE_TTL_SIX_HOURS', 21600);
|
||||
define('CACHE_TTL_TWELVE_HOURS', 43200);
|
||||
|
||||
define('CACHE_TTL_ONE_DAY', 86400);
|
||||
|
||||
define('CACHE_TTL_ONE_WEEK', 604800);
|
73
helpers/constants/http_status_codes.php
Normal file
73
helpers/constants/http_status_codes.php
Normal file
@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| HTTP Status Codes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here is a collection of HTTP status codes and a corresponding string
|
||||
| that is human-friendly and easy to remember.
|
||||
|
|
||||
*/
|
||||
|
||||
$httpCodes = [
|
||||
// 100's (informational / "hold on")
|
||||
100 => 'HTTP_CONTINUE',
|
||||
101 => 'HTTP_SWITCHING_PROTOCOLS',
|
||||
102 => 'HTTP_PROCESSING',
|
||||
103 => 'HTTP_EARLY_HINTS',
|
||||
|
||||
// 200's (successful / "here you go")
|
||||
200 => 'HTTP_SUCCESS',
|
||||
201 => 'HTTP_CREATED',
|
||||
202 => 'HTTP_ACCEPTED',
|
||||
204 => 'HTTP_NO_CONTENT',
|
||||
205 => 'HTTP_RESET_CONTENT',
|
||||
206 => 'HTTP_PARTIAL_CONTENT',
|
||||
|
||||
// 300's (redirections / "go away")
|
||||
300 => 'HTTP_MULTIPLE_CHOICE',
|
||||
301 => 'HTTP_MOVED_PERMANENTLY',
|
||||
302 => 'HTTP_REDIRECT_FOUND',
|
||||
303 => 'HTTP_SEE_OTHER',
|
||||
304 => 'HTTP_NOT_MODIFIED',
|
||||
307 => 'HTTP_TEMPORARY_REDIRECT',
|
||||
308 => 'HTTP_PERMANENT_REDIRECT',
|
||||
|
||||
// 400's (app got the request but couldn't process it successfully, coding error / "user screwed up")
|
||||
400 => 'HTTP_BAD_REQUEST',
|
||||
401 => 'HTTP_UNAUTHORIZED',
|
||||
402 => 'HTTP_PAYMENT_REQUIRED',
|
||||
403 => 'HTTP_FORBIDDEN',
|
||||
404 => 'HTTP_NOT_FOUND',
|
||||
405 => 'HTTP_METHOD_NOT_ALLOWED',
|
||||
406 => 'HTTP_NOT_ACCEPTABLE',
|
||||
408 => 'HTTP_TIMEOUT',
|
||||
409 => 'HTTP_CONFLICT',
|
||||
410 => 'HTTP_GONE',
|
||||
412 => 'HTTP_PRECONDITION_FAILED',
|
||||
413 => 'HTTP_PAYLOAD_TOO_LARGE',
|
||||
415 => 'HTTP_UNSUPPORTED_MEDIA',
|
||||
413 => 'HTTP_TOO_LARGE',
|
||||
417 => 'HTTP_EXPECTATION_FAIL',
|
||||
418 => 'HTTP_TEAPOT',
|
||||
422 => 'HTTP_UNPROCESSABLE_ENTITY',
|
||||
423 => 'HTTP_LOCKED',
|
||||
424 => 'HTTP_FAILED_DEPENDENCY',
|
||||
236 => 'HTTP_UPGRADE_REQUIRED',
|
||||
428 => 'HTTP_PRECONDITION_REQUIRED',
|
||||
429 => 'HTTP_TOO_MANY_REQUESTS',
|
||||
451 => 'HTTP_GAG_ORDER',
|
||||
|
||||
// 500's (server-level problem, process died or configuration is incorrect / "server screwed up")
|
||||
500 => 'HTTP_SERVER_ERROR',
|
||||
501 => 'HTTP_NOT_IMPLEMENTED',
|
||||
503 => 'HTTP_UNAVAILABLE',
|
||||
530 => 'HTTP_SUSPENDED',
|
||||
];
|
||||
|
||||
foreach ($httpCodes as $code => $slug) {
|
||||
if (! defined($slug)) {
|
||||
define($slug, $code);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user