originphp/dotenv

OriginPHP DotEnv

Installs: 8 319

Dependents: 3

Suggesters: 1

Security: 0

Stars: 2

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/originphp/dotenv

2.0.0 2021-01-04 11:26 UTC

This package is auto-updated.

Last update: 2025-10-04 23:02:59 UTC


README

license build coverage

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');