Version 1.0.1
·
12 commits
to master
since this release
Added
- Load
- Dotenv no longer autoload the
.envfile on creating a new instance by default. - To load the
.envfile on creating new instance, you now need to pass the second argument astruewhen instantiating the class. - You can now manually load the
.envfile by calling theload()method. load()method return Dotenv class.- Add new method
getInGroup(string $group),
- Dotenv no longer autoload the
// Create new instance with autoload
$dotenv = new \NAL\Dotenv\Dotenv('path/to/your/file/.env', true);
// Load manually
$dotenv = new \NAL\Dotenv\Dotenv('path/to/your/file/.env');
$dotenv->load();
// if you set your environment variables in group like this,
APP_URL='https://example.com/'
APP_KEY=1234567
// You can use `getInGroup` method to retrieve all of that same group variables,
$dotenv->getInGroup('APP');
// Output
array(2) {
[0] =>
string(7) "APP_URL"
[1] =>
string(7) "APP_KEY"
}- Remove deleted variables
- This includes removing deleted environment variables from
$_SERVER,$_ENV, andgetenv().
- This includes removing deleted environment variables from