originphp / dotenv
OriginPHP DotEnv
Installs: 8 307
Dependents: 3
Suggesters: 1
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
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');