Updated CreateDatabaseCommand to create the empty database if it does not exist

This commit is contained in:
Alejandro Celaya
2019-08-05 10:08:59 +02:00
parent 3916b06e7c
commit f78fa58cf1
7 changed files with 132 additions and 22 deletions

View File

@@ -0,0 +1,17 @@
<?php
declare(strict_types=1);
namespace Shlinkio\Shlink\Common\Doctrine;
use Doctrine\DBAL\Connection;
use Doctrine\ORM\EntityManager;
use Psr\Container\ContainerInterface;
class ConnectionFactory
{
public function __invoke(ContainerInterface $container): Connection
{
$em = $container->get(EntityManager::class);
return $em->getConnection();
}
}