EnvFile
class EnvFile (View source)
Constants
| SOURCE_VAR |
|
| SOURCE_ENV |
|
| SOURCE_APACHE |
|
| SOURCE_APACHE_ALL |
|
| REGEX_ENTRY |
|
| REGEX_KEY |
|
Methods
Load variable from .env or from cache (if avaliable)
This method affect fill() and storeAsVars() methods
Refresh entries from the env file values.
Fill the values of environment variables
Store entries as PHP array
Store entries as $_ENV[
Magic method for set a manual entry
Magic method for get specific entry
Details
__construct(string $path)
Load variable from .env or from cache (if avaliable)
setOverride($enable)
This method affect fill() and storeAsVars() methods
refresh()
Refresh entries from the env file values.
Ideal for use before fill() or cache(), especially if there are any changes to the file.
fill(int $sources = self::SOURCE_VAR)
Fill the values of environment variables
bool
storeAsArray(string $path)
Store entries as PHP array
bool
storeAsVars(string $path)
Store entries as $_ENV[
__set(string $name, string|null $value)
Magic method for set a manual entry
string
__get(string $name)
Magic method for get specific entry