Env settings

This commit is contained in:
2021-06-14 17:49:21 -04:00
parent ee37338be4
commit 670d73be38
3 changed files with 20 additions and 6 deletions

View File

@ -1,7 +1,9 @@
<?php
include_once dirname(__DIR__) . '/bootstrap/dotenv.php';
return [
'mysql' => [
'host' => 'localhost',
'host' => $_ENV['MYSQL_HOST'],
//'port' => 3306,
'database' => $_ENV['MYSQL_DATABASE'],
'username' => $_ENV['MYSQL_USER'],

View File

@ -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',

14
setup/env/config.php vendored
View File

@ -1,6 +1,18 @@
<?php
use Dotenv\Dotenv;
$folder = dirname(__DIR__, 2);
$files = new DirectoryIterator($folder);
foreach ($files as $file) {
if ($file->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'
];