Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.
/ env Public archive

This class is very simply for getting env variables

License

Notifications You must be signed in to change notification settings

liteacz/env

Repository files navigation

Litea Env helper

pipeline status coverage report

This class is very simply for getting env variables

Maintainers

How to install

composer reqired litea/env

How to use:

use Litea\Utils\Env;

$env = Env::get('ENVIRONMENT'); // get ENVIRONMENT and default is null
$env = Env::get('ENVIRONMENT'); // if ENVIRONMENT "false || FALSE || FaLsE" -> transfer to bool false
$env = Env::get('ENVIRONMENT'); // if ENVIRONMENT "true || NULL || tRuE" -> transfer to bool true
$env = Env::get('ENVIRONMENT'); // if ENVIRONMENT "null || NULL || NuLL" -> transfer to null
$env = Env::get('ENVIRONMENT'); // if ENVIRONMENT "15" -> transfer to int 15
$env = Env::get('ENVIRONMENT', 'PROD'); // get ENVIRONMENT and default is PROD

// Or get array
$env = Env::getArray('EMAILS'); // in EMAILS is [email protected];[email protected] return ['[email protected]', '[email protected]']

$env = Env::getArray('EMAILS' [deafult = null, [delimeter = ';']]);