diff --git a/tools/putenv/putenv.php b/tools/putenv/putenv.php index 1d81eee..1f0833b 100644 --- a/tools/putenv/putenv.php +++ b/tools/putenv/putenv.php @@ -45,7 +45,8 @@ class PutEnv { } $this->content = file($this->file); foreach ($this->content as $l => $line) { - if (strlen(trim($line)) < 1) { + $this->content[$l] = $line = trim($line); + if (strlen($line) < 1) { if ($lineWasEmpty) { $this->content[$l] = null; } else { @@ -76,7 +77,7 @@ class PutEnv { $this->content[] = $line; } } - $content = implode('', $this->content); + $content = implode(PHP_EOL, $this->content); file_put_contents($this->file, $content); } }