Version: v0.7.1 - Beta.  We welcome contributors & feedback.

System.getEnvVar

System.getEnvVar($variableName, $default = '') -> any

Description

Get an environment variable.

The value will be converted to the appropriate type. (e.g. '15' is return as a the number 15)

If the variable does not exist, it will return $default.

System.getEnvVar('USER')
//= 'www-data'

System.getEnvVar('NON_EXISTENT', 'myDefault')
//= 'myDefault'

See Also