Свойство | Type | Description | |
---|---|---|---|
$filePath | string | The file path. | |
$immutable | boolean | Are we immutable? |
Méthode | Description | |
---|---|---|
__construct ( string $filePath, boolean $immutable = false ) : void | Create a new loader instance. | |
clearEnvironmentVariable ( string $name ) : void | Clear an environment variable. | |
getEnvironmentVariable ( string $name ) : string | null | Search the different places for environment variables and return first value found. | |
load ( ) : array | Load .env file in given directory. | |
processFilters ( string $name, string $value ) : array | Process the runtime filters. | |
setEnvironmentVariable ( string $name, string | null $value = null ) : void | Set an environment variable. |
Méthode | Description | |
---|---|---|
beginsWithAQuote ( string $value ) : boolean | Determine if the given string begins with a quote. | |
ensureFileIsReadable ( ) : void | Ensures the given filePath is readable. | |
isComment ( string $line ) : boolean | Determine if the line in the file is a comment, e.g. begins with a #. | |
looksLikeSetter ( string $line ) : boolean | Determine if the given line looks like it's setting a variable. | |
normaliseEnvironmentVariable ( string $name, string $value ) : array | Normalise the given environment variable. | |
readLinesFromFile ( string $filePath ) : array | Read lines from the file, auto detecting line endings. | |
resolveNestedVariables ( string $value ) : mixed | Resolve the nested variables. | |
sanitiseVariableName ( string $name, string $value ) : array | Strips quotes and the optional leading "export " from the environment variable name. | |
sanitiseVariableValue ( string $name, string $value ) : array | Strips quotes from the environment variable value. | |
splitCompoundStringIntoParts ( string $name, string $value ) : array | Split the compound string into parts. |
protected beginsWithAQuote ( string $value ) : boolean | ||
$value | string | |
Résultat | boolean |
public clearEnvironmentVariable ( string $name ) : void | ||
$name | string | |
Résultat | void |
protected ensureFileIsReadable ( ) : void | ||
Résultat | void |
protected looksLikeSetter ( string $line ) : boolean | ||
$line | string | |
Résultat | boolean |
protected readLinesFromFile ( string $filePath ) : array | ||
$filePath | string | |
Résultat | array |
protected resolveNestedVariables ( string $value ) : mixed | ||
$value | string | |
Résultat | mixed |