Skip to content

Commit

Permalink
✨ fixed .env procedence
Browse files Browse the repository at this point in the history
  • Loading branch information
mychidarko committed Nov 9, 2021
1 parent 3667c97 commit e35d14c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Router/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,15 +291,15 @@ public static function run(?callable $callback = null)
{
$config = static::$config;

$mode = _env("APP_ENV") == "false" ? \Leaf\Config::get("mode") : _env("APP_ENV");
$debug = _env("APP_DEBUG") == "false" ? \Leaf\Config::get("debug") : _env("APP_DEBUG");
$appDown = _env("APP_DOWN") == "false" ? \Leaf\Config::get("app.down") : _env("APP_DOWN");
$mode = _env("APP_ENV") ?? \Leaf\Config::get("mode");
$debug = _env("APP_DEBUG") ?? \Leaf\Config::get("debug");
$appDown = _env("APP_DOWN") ?? \Leaf\Config::get("app.down");

if (class_exists("Leaf\App")) {
$config = array_merge($config, [
"mode" => $mode,
"app.down" => $appDown,
"debug" => $debug === "false" ? $mode !== "production" : $debug,
"debug" => $debug ?? $mode !== "production",
]);
}

Expand Down

0 comments on commit e35d14c

Please sign in to comment.