dikki/dotenv

Just another dotenv library for PHP ripped-off from CodeIgniter 4

1.0.0 2023-09-14 16:35 UTC

This package is auto-updated.

Last update: 2024-10-14 19:20:18 UTC


README

This DotEnv component was ripped off from CodeIgniter 4 and created as a standalone component. It is a simple class that loads a .env file in the project root and sets the environment variables from it.

Usage

$dotenv = new Dikki\DotEnv\DotEnv(__DIR__); // directory where .env is present
$dotenv->load(); // load the vars from .env file

echo $_ENV['DEBUG']; // or getenv('DEBUG')