class Dotenv
Manages .env files.
VARNAME_REGEX | |
STATE_VARNAME | |
STATE_VALUE |
void | load(string $path, string ...$paths) Loads one or several .env files. | |
void | populate(array $values) Sets values as environment variables (via putenv, $_ENV, and $_SERVER). | |
array | parse(string $data, string $path = '.env') Parses the contents of an .env file. |
Loads one or several .env files.
string | $path | A file to load |
string | ...$paths | A list of additional files to load |
void |
FormatException | when a file has a syntax error |
PathException | when a file does not exist or is not readable |
Sets values as environment variables (via putenv, $_ENV, and $_SERVER).
Note that existing environment variables are not overridden.
array | $values | An array of env variables |
void |
Parses the contents of an .env file.
string | $data | The data to be parsed |
string | $path | The original file name where data where stored (used for more meaningful error messages) |
array | An array of env variables |
FormatException | when a file has a syntax error |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Dotenv/Dotenv.html