From b619224f887aa77d4bb2e26a0771975ef856c615 Mon Sep 17 00:00:00 2001 From: Dimitri Sitchet Tomkeu Date: Wed, 29 Jan 2025 10:07:06 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20modification=20d'une=20cl=C3=A9=20commen?= =?UTF-8?q?t=C3=A9=20du=20fichier=20.env?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Cli/Commands/Encryption/GenerateKey.php | 4 ++-- src/Loader/DotEnv.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Cli/Commands/Encryption/GenerateKey.php b/src/Cli/Commands/Encryption/GenerateKey.php index 5ec97731..3b2f7088 100644 --- a/src/Cli/Commands/Encryption/GenerateKey.php +++ b/src/Cli/Commands/Encryption/GenerateKey.php @@ -69,7 +69,7 @@ public function execute(array $params) $length = 32; } - $this->task('Génération d\'une nouvelle clé de chiffrememt'); + $this->task('Génération d\'une nouvelle clé de chiffrement'); $encodedKey = $this->generateRandomKey($prefix, $length); @@ -80,7 +80,7 @@ public function execute(array $params) } if (! $this->setNewEncryptionKey($encodedKey)) { - $this->writer->error('Erreur dans la configuration d\'une nouvelle clé de chiffrememt dans le fichier `.env`.', true); + $this->writer->error('Erreur dans la configuration d\'une nouvelle clé de chiffrement dans le fichier `.env`.', true); return; } diff --git a/src/Loader/DotEnv.php b/src/Loader/DotEnv.php index a474e97a..f78683e1 100644 --- a/src/Loader/DotEnv.php +++ b/src/Loader/DotEnv.php @@ -115,7 +115,7 @@ public function update(array $data = [], bool $reload = true): bool foreach ($env as $env_key => $env_value) { $entry = explode('=', $env_value, 2); $entry = array_map('trim', $entry); - if ($entry[0] === $key) { + if ($entry[0] === $key || $entry[0] === '# ' . $key) { $env[$env_key] = $key . '=' . (is_string($value) ? '"' . $value . '"' : $value); } else { $env[$env_key] = $env_value; @@ -280,7 +280,7 @@ protected function resolveNestedVariables(string $value): string $value = preg_replace_callback( '/\${([a-zA-Z0-9_]+)}/', - static function ($matchedPatterns) use ($loader): string { + static function ($matchedPatterns) use ($loader) { $nestedVariable = $loader->getVariable($matchedPatterns[1]); if (null === $nestedVariable) {