murilo-perosa/dot-env

Load .env files.

Installs: 5

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/murilo-perosa/dot-env

v0.0.2 2022-01-15 19:42 UTC

This package is auto-updated.

Last update: 2025-10-09 22:38:03 UTC


README

Latest Stable Version Total Downloads License PHP Version Require

Simple library to load and get values from .env file(s).

Install

composer require murilo-perosa/dot-env

How to Use

Namespace

use MuriloPerosa\DotEnv\DotEnv;

Load File

// enter path to .env file
(new DotEnv(__DIR__ . '/../.env'))->load();

Get Values

// php implementation
$value = getenv('YOUR_KEY');

// package implementation
$value = DotEnv::get('YOUR_KEY');

// package implementation with default value
$value = DotEnv::get('YOUR_KEY', 'DEFAULT_VALUE');