updating env example file

This commit is contained in:
2022-03-30 13:23:25 -06:00
parent f96e7eb0aa
commit 74055ea11b
20 changed files with 850 additions and 77 deletions

View File

@ -5,6 +5,10 @@ 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);

View File

@ -17,7 +17,16 @@ if (! function_exists('snake2Title')) {
}
if (! function_exists('carbon')) {
function carbon(?string $timestring = null)
/**
* Return a Carbon object based on a given timestring.
* It will attempt to find a timezone in the current
* session but default to UTC.
*
* @param string|null $timestring
*
* @return \Carbon\Carbon
*/
function carbon(?string $timestring = null): \Carbon\Carbon
{
$carbon = Carbon\Carbon::now(session('timezone_name'));
if (! empty($timestring)) {
@ -28,7 +37,15 @@ if (! function_exists('carbon')) {
}
if (! function_exists('jddayofweek')) {
function jddayofweek(?int $intDay = null, int $mode = 0)
/**
* Returns the day of the week. Can return a string or an integer depending on the mode.
*
* @param int|null $intDay
* @param int $mode
*
* @return string
*/
function jddayofweek(?int $intDay = null, int $mode = 0): string
{
if (is_null($intDay)) {
$intDay = date('l');
@ -41,3 +58,108 @@ if (! function_exists('jddayofweek')) {
return ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'][$intDay];
}
}
if (! function_exists('cel2Fah')) {
/**
* Convert from celsius to fahrenheit.
*
* @param float|int|string $celsius
* @param int $precision
*
* @return float
*/
function cel2Fah($celsius, int $preceision = 0): float
{
return round((($celsius * (9/5)) + 32), $preceision);
}
}
if (! function_exists('fah2Cel')) {
/**
* Convert from fahrenheit to celsius.
*
* @param float|int|string $fahrenheit
* @param int $precision
*
* @return float
*/
function fah2Cel($fahrenheit, int $preceision = 1): float
{
return round(($fahrenheit - 32 * (5/9)), $preceision);
}
}
if (! function_exists('meters2Miles')) {
/**
* Convert from meters to miles.
*
* @param float|int|string $meters
* @param int $precision
*
* @return float
*/
function meters2Miles($meters, int $preceision = 1): float
{
return round(($meters * 0.00062137), $preceision);
}
}
if (! function_exists('kilometers2Miles')) {
/**
* Convert from kilometers to meters.
*
* @param float|int|string $kilometers
* @param int $precision
*
* @return float
*/
function kilometers2Miles($kilometers, int $preceision = 1): float
{
return round(($kilometers * 1.609), $preceision);
}
}
if (! function_exists('m2Km')) {
/**
* Convert from meters to kilometers.
*
* @param float|int|string $meters
* @param int $precision
*
* @return float
*/
function m2Km($meters, int $preceision = 1): float
{
return round(($meters / 1000), $preceision);
}
}
if (! function_exists('mm2Inches')) {
/**
* Convert from milimeters to inches.
*
* @param float|int|string $milimeters
* @param int $precision
*
* @return float
*/
function mm2Inches($milimeters, int $preceision = 1): float
{
return round(($milimeters / 25.4), $preceision);
}
}
if (! function_exists('pa2Mbar')) {
/**
* Convert from pascals to milibars.
*
* @param float|int|string $pascals
* @param int $precision
*
* @return float
*/
function pa2Mbar($pascals, int $preceision = 1): float
{
return round(($pascals / 100), $preceision);
}
}