Common setup
This commit is contained in:
7
setup/common/settings.php
Normal file
7
setup/common/settings.php
Normal 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
30
setup/env/settings.php
vendored
Normal 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
6
setup/env/setups.php
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?php
|
||||||
|
use Psr\Container\ContainerInterface as Container;
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
];
|
Reference in New Issue
Block a user