config
This commit is contained in:
4
app_old/ui/settings/01_env.php
Normal file
4
app_old/ui/settings/01_env.php
Normal file
@ -0,0 +1,4 @@
|
||||
<?php
|
||||
return [
|
||||
'env' => $_ENV
|
||||
];
|
12
app_old/ui/settings/02_folders.php
Normal file
12
app_old/ui/settings/02_folders.php
Normal 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')
|
||||
]);
|
||||
}
|
||||
];
|
8
app_old/ui/settings/03_urls.php
Normal file
8
app_old/ui/settings/03_urls.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
return [
|
||||
'urls' => function() {
|
||||
return [
|
||||
'base' => 'http://localhost:8080'
|
||||
];
|
||||
}
|
||||
];
|
20
app_old/ui/settings/04_databases.php
Normal file
20
app_old/ui/settings/04_databases.php
Normal 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;
|
||||
}
|
||||
];
|
Reference in New Issue
Block a user