bluepsyduck / container-interop-doctrine-migrations
This package is abandoned and no longer maintained.
The author suggests using the roave/psr-container-doctrine package instead.
An extension to dasprid/container-interop-doctrine to support migrations.
1.0.0
2019-10-11 14:55 UTC
Requires
- php: ^7.2
- dasprid/container-interop-doctrine: ^1.1
- doctrine/migrations: ^1.8
Requires (Dev)
- bluepsyduck/test-helper: ^1.0
- phpstan/phpstan: ^0.11
- phpstan/phpstan-phpunit: ^0.11
- phpstan/phpstan-strict-rules: ^0.11
- phpunit/phpunit: ^8.0
- rregeer/phpunit-coverage-check: ^0.2
- squizlabs/php_codesniffer: ^3.3
This package is auto-updated.
Last update: 2020-11-11 09:45:53 UTC
README
DEPRECATED: Use package roave/psr-container-doctrine instead.
roave/psr-container-doctrine replaces dasprid/container-interop-doctrine with the addition of Doctrine Migrations, which makes this package obsolete.
This library is an extension to dasprid/container-interop-doctrine to support Doctrine Migrations.
Configuration
Extend your Doctrine configuration with the following values:
<?php use BluePsyduck\ContainerInteropDoctrineMigrations\MigrationsConfigurationFactory; return [ 'dependencies' => [ 'factories' => [ 'doctrine.migrations.orm_default' => MigrationsConfigurationFactory::class, ], ], 'doctrine' => [ 'migrations_configuration' => [ 'orm_default' => [ 'directory' => __DIR__ . '/../../data/database/migrations', 'name' => 'Fancy Service Database Migrations', 'namespace' => 'FancyService\Migrations', 'table' => '_Migrations', ], ], ], ];
Place the following content into a file config/cli-config.php
to use the Doctrine CLI tools:
<?php declare(strict_types=1); namespace BluePsyduck\FancyService; use Doctrine\DBAL\Migrations\Tools\Console\Helper\ConfigurationHelper; use Doctrine\ORM\EntityManager; use Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper; use Psr\Container\ContainerInterface; use Symfony\Component\Console\Helper\HelperSet; use Symfony\Component\Console\Helper\QuestionHelper; /* @var ContainerInterface $container */ $container = require(__DIR__ . '/container.php'); /* @var EntityManager $entityManager */ $entityManager = $container->get(EntityManager::class); return new HelperSet([ 'em' => new EntityManagerHelper($entityManager), 'question' => new QuestionHelper(), 'configuration' => new ConfigurationHelper( $entityManager->getConnection(), $container->get('doctrine.migrations.orm_default') ), ]);
From now on you can use the Doctrine CLI tools by calling their scripts, e.g.:
vendor/bin/doctrine-migrations migrations:status