Skip to content

Commit 09a6147

Browse files
committed
Allow configure Magento with env
1 parent b25db3e commit 09a6147

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/internal/Magento/Framework/App/DeploymentConfig.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,7 @@ public function isDbAvailable()
152152
private function getEnvOverride() : array
153153
{
154154
$env = getenv(self::MAGENTO_ENV_PREFIX . '_OVERRIDE');
155-
if (!empty($env)) {
156-
return json_decode($env, true) ?? [];
157-
}
158-
return [];
155+
return !empty($env) ? (json_decode($env, true) ?? []) : [];
159156
}
160157

161158
/**
@@ -214,7 +211,7 @@ private function flattenParams(array $params, $path = null, array &$flattenResul
214211
// allow reading values from env variables
215212
// value need to be specified in %env(NAME, "default value")% format
216213
// like %env(DB_PASSWORD)%, %env(DB_NAME, "test")%
217-
if (preg_match(self::ENV_NAME_PATTERN, $param,$matches)) {
214+
if (preg_match(self::ENV_NAME_PATTERN, $param, $matches)) {
218215
$param = getenv($matches['name']) ?: ($matches['default'] ?? null);
219216
}
220217

0 commit comments

Comments
 (0)