diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2017-09-25 00:03:22 +0200 |
---|---|---|
committer | Igor Scheller <igor.scheller@igorshp.de> | 2017-09-25 01:16:12 +0200 |
commit | 449e2cdd00632acff63bb75c5282c3aa2642b59f (patch) | |
tree | c677b8d03f0287b4a9cdc2deb2e59a63414085e3 /src | |
parent | c5c0a602aab908ed7bac3a87b7a574bef0a5ed8f (diff) |
Added env function, added GitLab CI code coverage config
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) |