Initialization - balint-horvath/dotenv-php GitHub Wiki
Usage (Instance)
Class
Namespace: \BalintHorvath\DotEnv\
Class: DotEnv
new \BalintHorvath\DotEnv\DotEnv($path)
Properties
(string)path: Directory of .env file or full path to your ini file. (default:../../../)(bool)setEnvironmentVariables: If it'strue, variables will be available via environment ($_ENV,getenv()), otherwise (iffalse) they'll be available only via the DotEnv as object or array ($dotenv->$dotenv[]). (default:true)(bool)processSections: If it'strue, variables will be organized under sections ($dotenv->section$dotenv[section]), otherwise sections will have no matter. (default:true)(bool)scannerMode: If it'sINI_SCANNER_TYPED, values0/off/"false"/falsewill becomeboolfalse, values1/on/"true"/truewill becomebooltrue. Can either beINI_SCANNER_NORMALorINI_SCANNER_RAW. IfINI_SCANNER_RAWis supplied, then option values will not be parsed. (See PHP Manual: parse_ini_file and PHP Manual: Predefined Constants for more.) (default:INI_SCANNER_TYPED)
Example
define('APP_DIR', dirname(__FILE__) . '/');
require 'vendor/autoload.php';
$dotenv = new \BalintHorvath\DotEnv\DotEnv(APP_DIR);