Skip to content

Commit

Permalink
Merge pull request #5 from louismariegaborit/master
Browse files Browse the repository at this point in the history
Compatibility Symfony 4
  • Loading branch information
thomasbeaujean authored Apr 16, 2018
2 parents e0cb916 + 3869b5b commit 99f269d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
7 changes: 7 additions & 0 deletions DependencyInjection/DoctrineMigrationToolsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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');
}
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 4 additions & 0 deletions Resources/config/services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
services:
A5sys\DoctrineMigrationToolsBundle\Command\MigrationsDiffFileDoctrineCommand:
public: false
tags: [console.command]
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}

0 comments on commit 99f269d

Please sign in to comment.