Commit af760c9a authored by Avris's avatar Avris

v4.0

parent 07c342a6
......@@ -15,7 +15,7 @@ use Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper;
use Doctrine\ORM\Tools\Setup;
use Psr\Log\LoggerInterface;
class Doctrine implements ParametersProvider, EventSubscriberInterface
class Doctrine implements EventSubscriberInterface
{
/** @var EntityManager */
protected $entityManager;
......@@ -108,20 +108,6 @@ class Doctrine implements ParametersProvider, EventSubscriberInterface
$app->add((new \Doctrine\ORM\Tools\Console\Command\GenerateProxiesCommand())->setName('db:generate:proxies'));
}
public function getDefaultParameters()
{
return [
'database' => [
'driver' => 'pdo_mysql',
'host' => '127.0.0.1',
'dbname' => 'micrus',
'user' => 'root',
'password' => null,
'charset' => 'utf8',
],
];
}
public function getSubscribedEvents(): iterable
{
yield 'consoleWarmup' => [$this, 'registerCommands'];
......
......@@ -3,8 +3,20 @@ namespace Avris\Micrus\Doctrine;
use Avris\Micrus\Bootstrap\ModuleInterface;
use Avris\Micrus\Bootstrap\ModuleTrait;
use Avris\Micrus\Tool\Config\ParametersProvider;
class DoctrineModule implements ModuleInterface
class DoctrineModule implements ModuleInterface, ParametersProvider
{
use ModuleTrait;
public function getParametersDefaults(): array
{
return [
'DB_DRIVER' => 'pdo_mysql',
'DB_HOST' => '127.0.0.1',
'DB_NAME' => 'micrus',
'DB_USER' => 'root',
'DB_PASS' => '',
];
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment