litea / env
Simply getter env variables
Installs: 14 162
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: ^7.2 || ^8.0
Requires (Dev)
- phpstan/phpstan: ^0.12.96
- phpunit/phpunit: ^9
- rector/rector: ^0.11.51
- slevomat/coding-standard: ^7.0
- squizlabs/php_codesniffer: ^3.6
README
This class is very simply for getting env variables
Maintainers
- Michal Odcházel - michal.odchazel@litea.cz
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 abc@litea.cz;ccc@litea.cz return ['abc@litea.cz', 'ccc@litea.cz'] $env = Env::getArray('EMAILS' [deafult = null, [delimeter = ';']]);