Skip to content

Commit b619224

Browse files
committed
fix: modification d'une clé commenté du fichier .env
1 parent 222cd6c commit b619224

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/Cli/Commands/Encryption/GenerateKey.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function execute(array $params)
6969
$length = 32;
7070
}
7171

72-
$this->task('Génération d\'une nouvelle clé de chiffrememt');
72+
$this->task('Génération d\'une nouvelle clé de chiffrement');
7373

7474
$encodedKey = $this->generateRandomKey($prefix, $length);
7575

@@ -80,7 +80,7 @@ public function execute(array $params)
8080
}
8181

8282
if (! $this->setNewEncryptionKey($encodedKey)) {
83-
$this->writer->error('Erreur dans la configuration d\'une nouvelle clé de chiffrememt dans le fichier `.env`.', true);
83+
$this->writer->error('Erreur dans la configuration d\'une nouvelle clé de chiffrement dans le fichier `.env`.', true);
8484

8585
return;
8686
}

src/Loader/DotEnv.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function update(array $data = [], bool $reload = true): bool
115115
foreach ($env as $env_key => $env_value) {
116116
$entry = explode('=', $env_value, 2);
117117
$entry = array_map('trim', $entry);
118-
if ($entry[0] === $key) {
118+
if ($entry[0] === $key || $entry[0] === '# ' . $key) {
119119
$env[$env_key] = $key . '=' . (is_string($value) ? '"' . $value . '"' : $value);
120120
} else {
121121
$env[$env_key] = $env_value;
@@ -280,7 +280,7 @@ protected function resolveNestedVariables(string $value): string
280280

281281
$value = preg_replace_callback(
282282
'/\${([a-zA-Z0-9_]+)}/',
283-
static function ($matchedPatterns) use ($loader): string {
283+
static function ($matchedPatterns) use ($loader) {
284284
$nestedVariable = $loader->getVariable($matchedPatterns[1]);
285285

286286
if (null === $nestedVariable) {

0 commit comments

Comments
 (0)