프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$filePath | string | The file path. | |
$immutable | boolean | Are we immutable? |
메소드 | 설명 | |
---|---|---|
__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. |
메소드 | 설명 | |
---|---|---|
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 | |
리턴 | boolean |
public clearEnvironmentVariable ( string $name ) : void | ||
$name | string | |
리턴 | void |
protected ensureFileIsReadable ( ) : void | ||
리턴 | void |
protected looksLikeSetter ( string $line ) : boolean | ||
$line | string | |
리턴 | boolean |
protected readLinesFromFile ( string $filePath ) : array | ||
$filePath | string | |
리턴 | array |
protected resolveNestedVariables ( string $value ) : mixed | ||
$value | string | |
리턴 | mixed |