aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Config.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Config.php')
-rw-r--r--lib/private/Config.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/private/Config.php b/lib/private/Config.php
index cbdbc5b2e64..0a868be7832 100644
--- a/lib/private/Config.php
+++ b/lib/private/Config.php
@@ -47,6 +47,8 @@ class Config {
/** @var array Associative array ($key => $value) */
protected $cache = [];
+ /** @var array */
+ protected $envCache = [];
/** @var string */
protected $configDir;
/** @var string */
@@ -88,9 +90,9 @@ class Config {
* @return mixed the value or $default
*/
public function getValue($key, $default = null) {
- $envValue = getenv(self::ENV_PREFIX . $key);
- if ($envValue !== false) {
- return $envValue;
+ $envKey = self::ENV_PREFIX . $key;
+ if (isset($this->envCache[$envKey])) {
+ return $this->envCache[$envKey];
}
if (isset($this->cache[$key])) {
@@ -222,6 +224,8 @@ class Config {
flock($filePointer, LOCK_UN);
fclose($filePointer);
}
+
+ $this->envCache = getenv();
}
/**