Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 

php-dotenv

A simple and standalone DotEnv parser for PHP 5.6+ wich sticks to a unique goal : parse a Dotenv string/file and restitute it as an array of variables.

Documentation

Full documentation is available at https://packages.bgaze.fr/php-dotenv

Quick start

Simply install the library using composer:

composer require bgaze/php-dotenv

Use the Helpers class to parse DotenEnv file or string:

use \Bgaze\Dotenv\Helpers as DotEnv;

try {
    var_dump(DotEnv::fromString('a dotenv string', [ /* some default values */ ]));
    var_dump(DotEnv::fromFile('path/to/dotenv/file', [ /* some default values */ ]));
} catch (\Exception $e) {
    echo "<pre>{$e}</pre>";
}

About

A simple and standalone DotEnv parser for PHP 5.6+

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages