Allow . in variables

This commit is contained in:
2021-10-14 13:36:50 +09:00
parent 75367b2724
commit 6cc09fb089
2 changed files with 3 additions and 1 deletions

View File

@@ -42,7 +42,7 @@ function readEnvFile(string $path = __DIR__, string $env_file = '.env'): int
$var = '';
while ($line = fgets($fp)) {
// main match for variable = value part
if (preg_match("/^\s*([\w_]+)\s*=\s*((\"?).*)/", $line, $matches)) {
if (preg_match("/^\s*([\w_.]+)\s*=\s*((\"?).*)/", $line, $matches)) {
$var = $matches[1];
$value = $matches[2];
$quotes = $matches[3];