Skip to content
Snippets Groups Projects
Commit 4bfc6e8c authored by jurgenhaas's avatar jurgenhaas
Browse files

composer/plugin/drupal-environment#10 Use getenv() as fallback for $_ENV

parent 2204e057
No related branches found
No related tags found
1 merge request!7Merging develop into main
Pipeline #734758 passed
......@@ -94,7 +94,7 @@ final class Dotenv {
*/
public function receiveGlobal(string $key, string $prompt, string $default = ''): string {
$key = strtoupper($key);
$value = getenv($key);
$value = $_ENV[$key] ?? getenv($key);
if ($value === FALSE) {
if (!empty($prompt) && $this->io->isInteractive()) {
$value = $this->io->ask($prompt . ': ');
......@@ -205,7 +205,7 @@ final class Dotenv {
*/
private function replaceItemEnvironmentVariables(string $item, array $matches): string {
foreach ($matches as $var) {
$value = getenv($var);
$value = $_ENV[$var] ?? getenv($var);
if ($value === FALSE) {
$value = '';
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment