diff --git a/Tina4/Env.php b/Tina4/Env.php index 14e596e..a970a4a 100644 --- a/Tina4/Env.php +++ b/Tina4/Env.php @@ -62,10 +62,12 @@ private function parseLine($line): void */ final public function readParams(?string $environment): void { - if (!defined("TINA4_DOCUMENT_ROOT")) { - define("TINA4_DOCUMENT_ROOT", "./"); + if (defined("TINA4_DOCUMENT_ROOT")) { + $rootFolder = TINA4_DOCUMENT_ROOT; + } else { + $rootFolder = "./"; } - $fileName = TINA4_DOCUMENT_ROOT . ".env"; + $fileName = $rootFolder. ".env"; if (!empty($environment)) { $fileName .= ".{$environment}";