Skip to content

Commit

Permalink
Merge pull request #3 from symfony-bundles/dev
Browse files Browse the repository at this point in the history
Load extension configuration
  • Loading branch information
khaperets committed May 24, 2016
2 parents fb2fb9c + 99d2f62 commit 66a9d4e
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions BundleDependency.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace SymfonyBundles\BundleDependency;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass;

trait BundleDependency
{
Expand Down Expand Up @@ -86,19 +85,16 @@ protected function createBundles(array $dependencies)
*/
protected function initializeBundles(ContainerBuilder $container)
{
$extensions = [];

foreach ($this->instances as $bundle) {
if ($extension = $bundle->getContainerExtension()) {
$container->registerExtension($bundle->getContainerExtension());
$extensions[] = $extension->getAlias();
$container->registerExtension($extension);

$extension->load([], $container);
}

$bundle->build($container);
}

$container->getCompilerPassConfig()->setMergePass(new MergeExtensionConfigurationPass($extensions));

foreach ($this->instances as $bundle) {
$bundle->setContainer($container);
$bundle->boot();
Expand Down

0 comments on commit 66a9d4e

Please sign in to comment.