This commit is contained in:
Juan Pablo Vial
2023-07-24 20:41:38 -04:00
parent 6ab24c8961
commit be33305cf1
612 changed files with 11436 additions and 107 deletions

View File

@ -0,0 +1,4 @@
<?php
return [
'env' => $_ENV
];

View File

@ -0,0 +1,12 @@
<?php
return [
'folders' => function() {
return new DI\Container([
'base' => dirname(__FILE__, 3),
'resources' => DI\String('{base}/resources'),
'routes' => DI\String('{resources}/routes'),
'templates' => DI\String('{resources}/views'),
'cache' => DI\String('{base}/cache')
]);
}
];

View File

@ -0,0 +1,8 @@
<?php
return [
'urls' => function() {
return [
'base' => 'http://localhost:8080'
];
}
];

View File

@ -0,0 +1,20 @@
<?php
use Psr\Container\ContainerInterface;
return [
'databases' => function(ContainerInterface $container) {
$env = $container->get('env');
$arr = [
ORM::DEFAULT_CONNECTION => (object) [
'host' => $env['MYSQL_HOST'],
'database' => $env['MYSQL_DATABASE'],
'username' => $env['MYSQL_USER'],
'password' => $env['MYSQL_PASSWORD']
]
];
if (isset($env['MYSQL_PORT'])) {
$arr[ORM::DEFAULT_CONNECTION]->port = $env['MYSQL_PORT'];
}
return (object) $arr;
}
];