From 3869b5b459d2ebc2b90332c6d94f79ff41b04534 Mon Sep 17 00:00:00 2001 From: Louis-Marie Gaborit Date: Fri, 13 Apr 2018 16:58:04 +0200 Subject: [PATCH] Compatibility Symfony 4 Compatibility Symfony 4 Compatibility Symfony 4 --- DependencyInjection/DoctrineMigrationToolsExtension.php | 7 +++++++ README.md | 4 ++-- Resources/config/services.yml | 4 ++++ composer.json | 6 +++--- 4 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 Resources/config/services.yml diff --git a/DependencyInjection/DoctrineMigrationToolsExtension.php b/DependencyInjection/DoctrineMigrationToolsExtension.php index e84f019..4d6c9d0 100644 --- a/DependencyInjection/DoctrineMigrationToolsExtension.php +++ b/DependencyInjection/DoctrineMigrationToolsExtension.php @@ -2,6 +2,8 @@ namespace A5sys\DoctrineMigrationToolsBundle\DependencyInjection; +use Symfony\Component\Config\FileLocator; +use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\DependencyInjection\Extension; @@ -17,5 +19,10 @@ public function load(array $configs, ContainerBuilder $container) { $configuration = new Configuration(); $this->processConfiguration($configuration, $configs); + + $locator = new FileLocator(__DIR__.'/../Resources/config/'); + $loader = new YamlFileLoader($container, $locator); + + $loader->load('services.yml'); } } diff --git a/README.md b/README.md index 0eec5b9..eb2a530 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,13 @@ Tools for the doctrine migration bundle composer require a5sys/doctrine-migration-tools-bundle:dev-master -# Generate versions from schema file for the doctrine-migration +# Generate versions from schema file for the doctrine-migration The diff command of doctrine generate the version file from the diff between your database and the current schema. This command generate the version from the diff between the schema stored in a file and your current schema. So you only have to run the command before doing a new version of your app. - php app/console doctrine:migrations:diff-file + php bin/console doctrine:migrations:diff-file A version file will be generated (if required) and your current schema will be dumped in a file. (in /app/DoctrineMigrations/SchemaVersion) diff --git a/Resources/config/services.yml b/Resources/config/services.yml new file mode 100644 index 0000000..537c1d8 --- /dev/null +++ b/Resources/config/services.yml @@ -0,0 +1,4 @@ +services: + A5sys\DoctrineMigrationToolsBundle\Command\MigrationsDiffFileDoctrineCommand: + public: false + tags: [console.command] diff --git a/composer.json b/composer.json index 3aff580..fa9fdfe 100644 --- a/composer.json +++ b/composer.json @@ -6,9 +6,9 @@ }, "license": "MIT", "require": { - "php": ">=5.4.0", - "symfony/framework-bundle": "~2.3|~3.0", + "php": ">=7.1", + "symfony/framework-bundle": "~4.0", "doctrine/doctrine-bundle": "~1.0", - "doctrine/migrations": "~1.4" + "doctrine/migrations": "~1.6" } }