Skip to content
Snippets Groups Projects
Commit 76468a85 authored by jurgenhaas's avatar jurgenhaas
Browse files

Improve verification if env variable is defined

parent b31ae325
No related branches found
No related tags found
No related merge requests found
......@@ -86,12 +86,11 @@ final class Dotenv {
public function receiveGlobal($key, $prompt, $default = '') {
$key = strtoupper($key);
$value = getenv($key);
if (empty($value)) {
if ($value === FALSE) {
if ($this->io->isInteractive()) {
$value = $this->io->ask($prompt . ': ');
}
/** @noinspection NotOptimalIfConditionsInspection */
if (empty($value)) {
if ($value === FALSE) {
$value = $default;
}
$this->put($key, $value, TRUE);
......
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