Class DotEnv

Summary

Fully Qualified Name: CodeIgniter\Config\DotEnv

Description

Environment-specific configuration

Methods

Name Description Defined By
__construct() Builds the path to our file. DotEnv
load() The main entry point, will load the .env file and process it so that we end up with all settings in the PHP environment vars (i.e. getenv(), $_ENV, and $_SERVER) DotEnv
normaliseVariable() Parses for assignment, cleans the $name and $value, and ensures that nested variables are handled. DotEnv
parse() Parse the .env file into an array of key => value DotEnv

Method Details

__construct()

Builds the path to our file.

Parameter Name Type Description
$path string
$file string

Returns:

load()

The main entry point, will load the .env file and process it so that we end up with all settings in the PHP environment vars (i.e. getenv(), $_ENV, and $_SERVER)

Returns: bool

normaliseVariable()

Parses for assignment, cleans the $name and $value, and ensures that nested variables are handled.

Parameter Name Type Description
$name string
$value string

Returns: array

parse()

Parse the .env file into an array of key => value

Returns: array|null

Top