Common setup

This commit is contained in:
2021-03-15 17:41:48 -03:00
parent 5921890ee7
commit 2f79716a19
3 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,7 @@
<?php
return [
'locations' => function() {
$arr = ['base' => dirname(__DIR__, 2)];
return (object) $arr;
}
];

30
setup/env/settings.php vendored Normal file
View File

@ -0,0 +1,30 @@
<?php
use Dotenv\Dotenv;
$dotenv = Dotenv::createImmutable(dirname(__DIR__, 2));
$dotenv->load();
return [
'debug' => $_ENV['DEBUG'],
'databases' => function() {
$default = [
'system' => 'mysql',
'host' => (object) [
'name' => $_ENV['DB_HOST'] ?? 'localhost'
],
'user' => (object) [
'name' => $_ENV['DB_USER'] ?? 'money',
'password' => $_ENV['DB_PASSWORD'] ?? 'password'
],
'name' => $_ENV['DB_NAME'] ?? 'money'
];
if (isset($_ENV['DB_PORT'])) {
$default['host']->port = $_ENV['DB_PORT'];
}
$arr = [
'short_names' => true,
'default' => (object) $default
];
return (object) $arr;
}
];

6
setup/env/setups.php vendored Normal file
View File

@ -0,0 +1,6 @@
<?php
use Psr\Container\ContainerInterface as Container;
return [
];