rfussien/dotenv

dotenv loader/parser improved for performance

v1.0.0 2017-02-02 12:13 UTC

This package is auto-updated.

Last update: 2024-12-13 06:43:35 UTC


README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Requirements

PHP >= 5.6 | >= 7.0 | >= 7.1
⚠️ HHVM not supported so far ⚠️

Install

Via Composer

$ composer require rfussien/dotenv

Usage

$dotenv = new Rfussien\Dotenv\Loader(__DIR__);
$dotenv->load();

// optionally you can set a different filename (by defaul .env)
$dotenv = new Rfussien\Dotenv\Loader(__DIR__, '.my.env');
$dotenv->load();

Why should I use this dotenv loader instead of another ?

This package is meant to be faster than the other dotenv loaders.
But please, don't believe me, check my small benchmark out, and try it by yourself.

It has less features, but come on, it's about a config file and a minimum computing should be done...

IMHO:

  • A real boolean MUST NOT be between quotes
  • A string SHOULD be between quotes or double quotes
  • An empty value is not null, but an empty string
  • Computing nested values every single time my app runs is a waste of time

Results

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email remi.fussien@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.