Loads env.json
file contents into php $_ENV
global variable.
Simply add the library to your composer.json
composer require dnlnrs/envjson
Create a new instance of Loader
class, passing the path of the env.json
file and the name (default to env.json
) and then call the load
method.
Example:
use dnlrs\envjson\Loader;
$loader = new Loader(__DIR__);
$loader->load();
Now your $_ENV
contaons the env.json
contents.