originphp / dotenv
OriginPHP DotEnv
2.0.0
2021-01-04 11:26 UTC
Requires
- php: >=7.3.0
Requires (Dev)
- phpstan/phpstan: ^0.12.64
- phpunit/phpunit: ^9.2
README
A dotenv parser.
Installation
To install this package
$ composer require originphp/dotenv
Then in your application bootstrap
use Origin\DotEnv\DotEnv; (new DotEnv())->load(__DIR__);
Here is an example of a dotenv file.
GMAIL_USERNAME=foo@gmail.com
GMAIL_PASSWORD=secret
You can also add export in front of each line so you can source the file with bash.
export GMAIL_USERNAME=foo@gmail.com
export GMAIL_PASSWORD=secret
If you want to use a custom name
use Origin\DotEnv\DotEnv; (new DotEnv())->load(__DIR__,'.env-local');