diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/helpers.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/helpers.php b/src/helpers.php index c3c727ec..5a48498a 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -67,6 +67,21 @@ function config_path($path = '') /** * @param string $key * @param mixed $default + * @return mixed + */ +function env($key, $default = null) +{ + $value = getenv($key); + if ($value === false) { + return $default; + } + + return $value; +} + +/** + * @param string $key + * @param mixed $default * @return Request|mixed */ function request($key = null, $default = null) |