krzysztofzylka / env
ENV library
1.0.2
2024-01-21 02:09 UTC
Requires
- php: >=8.0
Requires (Dev)
- phpunit/phpunit: ^10.5
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.