From e37815352b8e593ed8eacb746364c02f639dcd00 Mon Sep 17 00:00:00 2001 From: Sieciech Date: Sun, 29 Aug 2021 09:49:27 +0200 Subject: [PATCH] new --- tools/putenv/putenv.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); } }