Skip to content

Commit

Permalink
Merge pull request #13 from redthor/feature/sf4-support
Browse files Browse the repository at this point in the history
Add sf4 support, care of @w473
  • Loading branch information
redthor authored Mar 28, 2018
2 parents 78395c3 + e5083b3 commit 4453202
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
7 changes: 6 additions & 1 deletion DependencyInjection/MongoDBMigrationsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

namespace AntiMattr\Bundle\MongoDBMigrationsBundle\DependencyInjection;

use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;

Expand All @@ -32,8 +34,11 @@ public function load(array $configs, ContainerBuilder $container)
$config = $this->processConfiguration($configuration, $configs);

foreach ($config as $key => $value) {
$container->setParameter($this->getAlias().'.'.$key, $value);
$container->setParameter($this->getAlias() . '.' . $key, $value);
}

$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('services.xml');
}

/**
Expand Down
44 changes: 44 additions & 0 deletions Resources/config/services.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>

<service
id="AntiMattr\Bundle\MongoDBMigrationsBundle\Command\MigrationsMigrateCommand"
class="AntiMattr\Bundle\MongoDBMigrationsBundle\Command\MigrationsMigrateCommand"
>
<tag name="console.command"/>
</service>

<service
id="AntiMattr\Bundle\MongoDBMigrationsBundle\Command\MigrationsExecuteCommand"
class="AntiMattr\Bundle\MongoDBMigrationsBundle\Command\MigrationsExecuteCommand"
>
<tag name="console.command"/>
</service>

<service
id="AntiMattr\Bundle\MongoDBMigrationsBundle\Command\MigrationsGenerateCommand"
class="AntiMattr\Bundle\MongoDBMigrationsBundle\Command\MigrationsGenerateCommand"
>
<tag name="console.command"/>
</service>

<service
id="AntiMattr\Bundle\MongoDBMigrationsBundle\Command\MigrationsStatusCommand"
class="AntiMattr\Bundle\MongoDBMigrationsBundle\Command\MigrationsStatusCommand"
>
<tag name="console.command"/>
</service>

<service
id="AntiMattr\Bundle\MongoDBMigrationsBundle\Command\MigrationsVersionCommand"
class="AntiMattr\Bundle\MongoDBMigrationsBundle\Command\MigrationsVersionCommand"
>
<tag name="console.command"/>
</service>

</services>
</container>

0 comments on commit 4453202

Please sign in to comment.