2017 © Pedro Peláez
 

library dotenv

Load .env file into project environment, using same functions as Laravel

image

mykehowells/dotenv

Load .env file into project environment, using same functions as Laravel

  • Monday, June 18, 2018
  • by mykemeynell
  • Repository
  • 1 Watchers
  • 2 Stars
  • 2,930 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 19 % Grown

The README.md

dotenv Environment Manager

Stable version Unstable version, (*1)

If you have used Laravel and gotten used to being able to set and switch between environments as easily as swapping out a .env file., (*2)

Using mykehowells/dotenv, you can now add that functionality to your own projects with composer., (*3)

Install via Composer

Add mykehowells/dotenv to your project via composer with the following line:, (*4)

composer require mykehowells/dotenv, (*5)

Add the below code to check for a .env file, and import if it exists. Preferably, you should store this file outside of any publicly accessible directories, as it will contain potentially sensitive data - such as database credentials., (*6)

Check out the vlucas/phpdotenv readme for more info on that package., (*7)

/*----------------------------------------------------------------------------
| ENV CONFIGURATION
|-----------------------------------------------------------------------------
|
| Check to see if an env file exists at project root, if it does, import
| keys and values into putenv( $setting ), otherwise env( $key, $default=null )
| will return default value.
|
|---------------------------------------------------------------------------*/
load_env( __DIR__ );

You can then start using the env( $key, $default = null ) function to retrieve data from your .env file., (*8)

The Versions

18/06 2018

dev-master

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

Load .env file into project environment, using same functions as Laravel

  Sources   Download

GPL

The Requires

 

laravel dot php development environment env dotenv production

05/01 2017

1.0.3

1.0.3.0 https://github.com/mykemeynell/dotenv

Load .env file into project environment, using same functions as Laravel

  Sources   Download

GPL

The Requires

 

laravel dot php development environment env dotenv production

09/03 2016

1.0.2

1.0.2.0 https://github.com/mykehowells/dotenv

Load .env file into project environment, using same functions as Laravel

  Sources   Download

GPL

The Requires

 

laravel dot php development environment env dotenv production

09/03 2016

1.0.1

1.0.1.0 https://github.com/mykehowells/dotenv

Load .env file into project environment, using same functions as Laravel

  Sources   Download

GPL

The Requires

 

laravel dot php development environment env dotenv production

09/03 2016

1.0.0

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

Load .env file into project environment, using same functions as Laravel

  Sources   Download

GPL

The Requires

 

laravel dot php development environment env dotenv production