Skip to content

Latest commit

 

History

History
51 lines (39 loc) · 1.05 KB

README.md

File metadata and controls

51 lines (39 loc) · 1.05 KB

Dotenv

Latest Version on Packagist Total Downloads

Installation

Install package via composer:

composer require m4rku5/dotenv

Usage

From .env ...

# DOCKER:
DOCKER_PORT=8001

# PROJECT:
#PROJECT_DOCUMENTROOT=public
#PROJECT_LOGS=logs

... doing ...

$dotenv = new Dotenv('.env');
$dotenv->set('PROJECT_DOCUMENTROOT', 'test');
$dotenv->enable('PROJECT_DOCUMENTROOT');
$dotenv->set('HELLO', 'World');
$dotenv->disable('HELLO');
$dotenv->unset('DOCKER_PORT');
$dotenv->save();

... will result in ...

# DOCKER:

# PROJECT:
PROJECT_DOCUMENTROOT=test
#PROJECT_LOGS=logs

#HELLO=World

Changelog

Please see CHANGELOG for more information on what has changed recently.

License

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