fix
This commit is contained in:
parent
996d201575
commit
d135a4ec75
|
@ -44,7 +44,7 @@ class PutEnv {
|
||||||
foreach ($this->content as $l => $line) {
|
foreach ($this->content as $l => $line) {
|
||||||
if (strlen($line) < 1) {
|
if (strlen($line) < 1) {
|
||||||
if ($lineWasEmpty) {
|
if ($lineWasEmpty) {
|
||||||
unset ($this->content[$l]);
|
$this->content[$l] = null;
|
||||||
} else {
|
} else {
|
||||||
$lineWasEmpty = true;
|
$lineWasEmpty = true;
|
||||||
}
|
}
|
||||||
|
@ -66,6 +66,13 @@ class PutEnv {
|
||||||
} else if ($changed > 1) {
|
} else if ($changed > 1) {
|
||||||
echo "Key $key changed $changed times\n";
|
echo "Key $key changed $changed times\n";
|
||||||
}
|
}
|
||||||
|
$content = $this->content;
|
||||||
|
$this->content = [];
|
||||||
|
foreach ($content as $line) {
|
||||||
|
if ($line !== null) {
|
||||||
|
$this->content[] = $line;
|
||||||
|
}
|
||||||
|
}
|
||||||
$content = implode("\n", $this->content);
|
$content = implode("\n", $this->content);
|
||||||
file_put_contents($this->file, $content);
|
file_put_contents($this->file, $content);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue