morainstein/dotenv

A simple lib for loading environment variables in PHP

Maintainers

Package info

github.com/morainstein/PHP-DotEnv

pkg:composer/morainstein/dotenv

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2025-07-29 17:08 UTC

This package is auto-updated.

Last update: 2026-03-29 01:13:17 UTC


README

A simple way to use your environment variables in PHP

Getting Started

composer require morainstein/dotenv
use Morainstein\DotEnv;

//You may also ommit the $envFilePath param, so it finds the .env in the working directory of application  
$dotenv = new DotEnv($envFilePath);

//Just simple as it looks!
$envValue = $dotenv->get('envKey')

Recomendation

Load the DotEnv class in your bootstrap file, then use it everywhere in your application