divineomega/dotenv-loader

This package is abandoned and no longer maintained. The author suggests using the jord-jd/dotenv-loader package instead.

Dotenv loader is a simple PHP library that will automatically load in a `.env` file from the root of your project into environment variables.

Maintainers

Package info

github.com/Jord-JD/dotenv-loader

pkg:composer/divineomega/dotenv-loader

Fund package maintenance!

DivineOmega

Statistics

Installs: 23 238

Dependents: 1

Suggesters: 0

Stars: 4

Open Issues: 1

v4.0.1 2026-02-15 00:11 UTC

This package is auto-updated.

Last update: 2026-02-15 03:11:37 UTC


README

The dotenv-loader is a simple PHP helper that automatically loads in a .env file from the root of your project into environment variables. It is designed for use in projects that do not already make use of a .env file.

Quick Start

Simple run composer require jord-jd/dotenv-loader to install.

You'll then be able to create a .env file in your project's root directory (in the same location as your composer.json file). Any variables in the .env file can then be accessed in any way you wish, such as using PHP's built-in getenv function.

For an actual example of how to use dotenv-loader, see the test directory.