rfussien / dotenv
dotenv loader/parser improved for performance
Installs: 4 969
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: ~5.6|~7.0
Requires (Dev)
- phpunit/phpunit: ^5.7
- squizlabs/php_codesniffer: ^2.3
This package is auto-updated.
Last update: 2024-12-13 06:43:35 UTC
README
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.