This commit is contained in:
Sieciech 2021-08-29 09:49:27 +02:00
parent 44c8481550
commit e37815352b
1 changed files with 3 additions and 2 deletions

View File

@ -45,7 +45,8 @@ class PutEnv {
} }
$this->content = file($this->file); $this->content = file($this->file);
foreach ($this->content as $l => $line) { foreach ($this->content as $l => $line) {
if (strlen(trim($line)) < 1) { $this->content[$l] = $line = trim($line);
if (strlen($line) < 1) {
if ($lineWasEmpty) { if ($lineWasEmpty) {
$this->content[$l] = null; $this->content[$l] = null;
} else { } else {
@ -76,7 +77,7 @@ class PutEnv {
$this->content[] = $line; $this->content[] = $line;
} }
} }
$content = implode('', $this->content); $content = implode(PHP_EOL, $this->content);
file_put_contents($this->file, $content); file_put_contents($this->file, $content);
} }
} }