0.1.0
This commit is contained in:
19
setup/setups/03_database.php
Normal file
19
setup/setups/03_database.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
use Psr\Container\ContainerInterface;
|
||||
|
||||
return [
|
||||
\Doctrine\DBAL\Connection::class => function(ContainerInterface $container) {
|
||||
$config = $container->get('database')->databases['default'];
|
||||
$conn = [
|
||||
'dbname' => $config->name,
|
||||
'user' => $config->user->name,
|
||||
'password' => $config->user->password,
|
||||
'host' => $config->host->name,
|
||||
'driver' => $config->driver
|
||||
];
|
||||
if (isset($config->host->port)) {
|
||||
$conn['port'] = $config->host->port;
|
||||
}
|
||||
return \Doctrine\DBAL\DriverManager::getConnection($conn);
|
||||
}
|
||||
];
|
Reference in New Issue
Block a user