v0.1.0
This commit is contained in:
25
backend/api/setup/env/settings.php
vendored
Normal file
25
backend/api/setup/env/settings.php
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
return [
|
||||
'base_url' => '',
|
||||
'debug' => $_ENV['DEBUG'],
|
||||
'databases' => function() {
|
||||
$settings = [
|
||||
'short_names' => true,
|
||||
'dbs' => []
|
||||
];
|
||||
$default = [
|
||||
'engine' => 'mysql',
|
||||
'host' => (object) [
|
||||
'name' => $_ENV['DB_HOST'],
|
||||
'port' => $_ENV['DB_PORT'] ?? null
|
||||
],
|
||||
'user' => (object) [
|
||||
'name' => $_ENV['MYSQL_USER'],
|
||||
'password' => $_ENV['MYSQL_PASSWORD']
|
||||
],
|
||||
'name' => $_ENV['MYSQL_DATABASE'] . ($_ENV['ENV'] ? '_' . $_ENV['ENV'] : '')
|
||||
];
|
||||
$settings['dbs']['default'] = (object) $default;
|
||||
return (object) $settings;
|
||||
}
|
||||
];
|
8
backend/api/setup/env/setups.php
vendored
Normal file
8
backend/api/setup/env/setups.php
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
use Psr\Container\ContainerInterface as Container;
|
||||
|
||||
return [
|
||||
ProVM\Common\Service\Database::class => function(Container $container) {
|
||||
return new ProVM\Common\Service\Database($container->get('databases'));
|
||||
}
|
||||
];
|
Reference in New Issue
Block a user