Update 2022-03-07

This commit is contained in:
2022-03-07 09:59:51 -03:00
committed by Juan Pablo Vial
parent f85f9ff3c9
commit 8ed1742de8
8 changed files with 110 additions and 18 deletions

18
setup/settings/01_env.php Normal file
View File

@ -0,0 +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' => $_ENV['DEBUG'] ?? false,
'benchmark' => false,
'base_url' => $_ENV['BASE_URL'] ?? '/incoviba'
];

View File

@ -0,0 +1,40 @@
<?php
return [
'timezone' => 'America/Santiago',
'locale' => 'es',
'database' => 'mysql',
'login_hours' => 5*24,
'cierres' => [
'caducidad' => 30
],
'databases' => function() {
$arr = [
'mysql' => [
'host' => $_ENV['MYSQL_HOST'],
//'port' => 3306,
'database' => $_ENV['MYSQL_DATABASE'],
'username' => $_ENV['MYSQL_USER'],
'password' => $_ENV['MYSQL_PASSWORD']
],
'mysql_copy' => [
'host' => 'localhost',
'database' => 'incoviba3',
'username' => 'incoviba',
'password' => '5GQYFvRjVw2A4KcD'
]
];
return $arr;
},
'locations' => function() {
$arr = ['base' => dirname(__DIR__, 2)];
$arr['public'] = $arr['base'] . '/public';
$arr['resources'] = $arr['base'] . '/resources';
$arr['routes'] = $arr['resources'] . '/routes';
$arr['src'] = $arr['base'] . '/src';
$arr['app'] = $arr['base'] . '/app';
$arr['controllers'] = $arr['app'] . '/Controller';
$arr['money'] = 'http://provm.cl/optimus/money';
$arr['api'] = 'http://localhost:8080/api';
return (object) $arr;
}
];

View File

@ -0,0 +1,8 @@
<?php
use Psr\Container\ContainerInterface as Container;
return [
'base_url' => DI\decorate(function($prev, Container $c) {
return $prev . '/api';
})
];

11
setup/settings/04_ui.php Normal file
View File

@ -0,0 +1,11 @@
<?php
use Psr\Container\ContainerInterface as Container;
return [
'locations' => DI\decorate(function($prev, Container $c) {
$arr = (array) $prev;
$arr['cache'] = $prev->base . '/cache';
$arr['views'] = $prev->resources . '/views';
return (object) $arr;
})
];