1.0.2 2024-01-21 02:09 UTC

This package is auto-updated.

Last update: 2024-04-21 02:36:43 UTC


README

This class is used for loading and parsing environment variables from a file.

Install

composer require krzysztofzylka/env

Load env file

$env = new \Krzysztofzylka\Env\Env('/path/to/env/file');
$env->load();

Load multiple env file

$env = new \Krzysztofzylka\Env\Env(['/path/to/env/file', '/path/to/env/file', ...]);
$env->load();

Example ENV file content

DB_HOST=localhost
DB_NAME=testDB
DB_USER=username
DB_PASS=password

Exceptions

File not found: If the given file path does not exist a File not found exception will be thrown.