2017 © Pedro Peláez
 

library dotenv

dotenv loader/parser improved for performance

image

rfussien/dotenv

dotenv loader/parser improved for performance

  • Sunday, February 5, 2017
  • by rfussien
  • Repository
  • 2 Watchers
  • 3 Stars
  • 1,683 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 13 % Grown

The README.md

dotenv

Latest Version on Packagist ![Software License][ico-license] Build Status ![Coverage Status][ico-scrutinizer] Quality Score ![Total Downloads][ico-downloads], (*1)

Requirements

PHP >= 5.6 | >= 7.0 | >= 7.1
:warning: HHVM not supported so far :warning:, (*2)

Install

Via Composer, (*3)

``` bash $ composer require rfussien/dotenv, (*4)


## Usage ``` php $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., (*5)

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

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, (*7)

Results

In the .env type value
K01=true bool true
K02=tRuE bool true
K03="true" string(4) "true"
K04=on bool true
K05=On bool true
K06="on" string(2) "on"
K07=yes bool true
K08=Yes bool true
K09="yes" string(3) "yes"
K10=false bool false
K11=fAlSe bool false
K12="false" string(5) "false"
K13=off bool false
K14=Off bool false
K15="off" string(3) "off"
K16=no bool false
K17=No bool false
K18="no" string(2) "no"
K19=1 int 1
K20=1.1 double 1.1
K21=value string(5) "value"
K22="value" string(5) "value"
K23="VaLuE" string(5) "VaLuE"
K24=VaLuE string(5) "VaLuE"
K25="value \" value" string(13) "value " value"
K26="value \"value\" value" string(19) "value "value" value"
K27="value 'value' value" string(19) "value 'value' value"
K28="" string(0) ""
K29= value string(5) "value"
K30='value' string(5) "value"
K31='' string(0) ""
K32= string(0) ""
K33=null NULL NULL

Testing

bash $ composer test, (*8)

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*9)

Security

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

Credits

License

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

The Versions

05/02 2017

dev-master

9999999-dev https://github.com/rfussien/dotenv

dotenv loader/parser improved for performance

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.0

 

The Development Requires

dotenv rfussien

02/02 2017

v1.0.0

1.0.0.0 https://github.com/rfussien/dotenv

dotenv loader/parser improved for performance

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.0

 

The Development Requires

dotenv rfussien