nigr / dotenv
dev-master
2025-07-13 16:23 UTC
Requires (Dev)
- phpunit/phpunit: ^10.5
This package is auto-updated.
Last update: 2025-07-13 16:23:31 UTC
README
Install library:
composer require nigr/dotenv:@dev
Call function than parsed ENV-file:
use Nigr/Dotenv; $dotenv = new Dotenv(); $dotenv->parse();
If file locates not in root folder, pass as argument path to file in function envPasre():
$dotenv = new Dotenv(); $dotenv->parse("/env/.env.dev");
For call variable, can use $_ENV, $_SERVER and getenv():
$_ENV['DB_USER']; $_SERVER['DB_HOST']; getenv('DB_PORT');