From 606fdc4d960ef7c3c9fbde309e1c752b7f22dd84 Mon Sep 17 00:00:00 2001 From: Aldarien Date: Mon, 14 Jun 2021 17:49:21 -0400 Subject: [PATCH] Env settings --- config/databases.php | 4 +++- setup/common/config.php | 8 ++++---- setup/env/config.php | 14 +++++++++++++- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/config/databases.php b/config/databases.php index 470a4cf..be9c0d4 100644 --- a/config/databases.php +++ b/config/databases.php @@ -1,7 +1,9 @@ [ - 'host' => 'localhost', + 'host' => $_ENV['MYSQL_HOST'], //'port' => 3306, 'database' => $_ENV['MYSQL_DATABASE'], 'username' => $_ENV['MYSQL_USER'], diff --git a/setup/common/config.php b/setup/common/config.php index d216b5f..b16515e 100644 --- a/setup/common/config.php +++ b/setup/common/config.php @@ -10,11 +10,11 @@ return [ 'databases' => function() { $arr = [ 'mysql' => [ - 'host' => 'localhost', + 'host' => $_ENV['MYSQL_HOST'], //'port' => 3306, - 'database' => 'incoviba', - 'username' => 'incoviba', - 'password' => '5GQYFvRjVw2A4KcD' + 'database' => $_ENV['MYSQL_DATABASE'], + 'username' => $_ENV['MYSQL_USER'], + 'password' => $_ENV['MYSQL_PASSWORD'] ], 'mysql_copy' => [ 'host' => 'localhost', diff --git a/setup/env/config.php b/setup/env/config.php index 48b0973..a38e55d 100644 --- a/setup/env/config.php +++ b/setup/env/config.php @@ -1,6 +1,18 @@ isDir() or $file->getExtension() != 'env') { + continue; + } + $env = Dotenv::createImmutable($file->getPath(), $file->getBasename()); + $env->load(); +} + return [ 'debug' => false, 'benchmark' => false, - 'base_url' => '/incoviba' + 'base_url' => $_ENV['BASE_URL']//'/incoviba' ];