damian972 / dotenv-loader
There is no license information available for the latest version (v1.0) of this package.
Load .env files into PHP
v1.0
2022-01-14 02:01 UTC
Requires
- php: >=8.0
README
Loads environment variables from .env
to getenv()
, $_ENV
and $_SERVER
.
Installation
composer require damian972/dotenv-loader
Usage
require 'vendor/autoload.php'; (new Damian972\DotenvLoader\Dotenv(__DIR__, fileName: '.env'))->load(); // fileName parameter is optionnal, default: .env echo 'API_LOGIN = '.getenv('API_LOGIN').PHP_EOL;