Automatically load in a `.env` file from the root of your project into environment variables
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
test
.gitignore
LICENSE
README.md
composer.json

README.md

dotenv-loader

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 DivineOmega/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.