Builds the bundle.

It is only ever called once when the cache is empty.

This method can be overridden to register compilation passes,
other extensions, ...

@param ContainerBuilder $container A ContainerBuilder instance
350821
public function build(ContainerBuilder $container)
    {
        parent::build($container);
        $container->addCompilerPass(new TransportCompilerPass());
        $container->addCompilerPass(new SpoolCompilerPass());
    }
607251
public function prepend(ContainerBuilder $container)
    {
        $configs = $container->getExtensionConfig($this->getAlias());
        $config = $this->processConfiguration(new Configuration(), $configs);

        $container->setAlias('opifer.content.content_manager', $config['content_manager']);
        $container->setDefinition('opifer.content.cache_provider', new Definition($config['cache_provider']));

        $parameters = $this->getParameters($config);
        foreach ($parameters as $key => $value) {
            $container->setParameter($key, $value);
        }

        $this->prependExtensionConfig($container, $config);
    }
837678
public function build(ContainerBuilder $container)
    {
        parent::build($container);

        $container->addCompilerPass(new ValidatorPass());
        $container->addCompilerPass(new FormPass());
        $container->addCompilerPass(new TwigLoaderPass());
    }
698083
public function process(ContainerBuilder $container)
    {
        do {
            $this->repeat = false;
            foreach ($this->passes as $pass) {
                $pass->process($container);
            }
        } while ($this->repeat);
    }
967242
public function prepend(ContainerBuilder $container): void
    {
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));

        $this->prependTwig($container, $loader);
    }
1022331
public function prepend(ContainerBuilder $container): void
    {
        // get all Bundles
        $bundles = $container->getParameter('kernel.bundles');
        // determine if McfedrQueueManagerBundle is registered
        if (isset($bundles['McfedrQueueManagerBundle'])) {
            $container->prependExtensionConfig('mcfedr_queue_manager', [
                'drivers' => [
                    'periodic' => [
                        'class' => PeriodicQueueManager::class,
                        'options' => [
                            'delay_manager' => null,
                            'delay_manager_options' => [],
                        ],
                    ],
                    'beanstalkd' => [
                        'class' => BeanstalkQueueManager::class,
                        'options' => [
                            'host' => '127.0.0.1',
                            'port' => 11300,
                            'default_queue' => 'default',
                            'connection' => [
                                'timeout' => 2,
                                'persistent' => false,
                            ],
                        ],
                        'command_class' => BeanstalkCommand::class,
                    ],
                    'doctrine_delay' => [
                        'class' => DoctrineDelayQueueManager::class,
                        'options' => [
                            'entity_manager' => null,
                            'default_manager' => null,
                            'default_manager_options' => [],
                        ],
                        'command_class' => DoctrineDelayRunnerCommand::class,
                    ],
                    'sqs' => [
                        'class' => SqsQueueManager::class,
                        'options' => [
                            'queues' => [],
                        ],
                        'command_class' => SqsRunnerCommand::class,
                    ],
                ],
            ]);
        }
    }
399602
public function build(ContainerBuilder $container)
    {
        parent::build($container);

        $container->addCompilerPass(
            new DocumentMapCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            100
        );
        $container->addCompilerPass(
            new ExtRefMappingCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            5
        );
        $container->addCompilerPass(
            new ExtRefFieldsCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            5
        );
        $container->addCompilerPass(
            new RqlFieldsCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            5
        );
        $container->addCompilerPass(
            new TranslatableFieldsCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            5
        );
        $container->addCompilerPass(
            new DocumentFieldNamesCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            5
        );
        $container->addCompilerPass(
            new ReadOnlyFieldsCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            5
        );
        $container->addCompilerPass(
            new RestrictionFieldsCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            5
        );
        $container->addCompilerPass(
            new RecordOriginExceptionFieldsCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            5
        );
        $container->addCompilerPass(
            new SolrDefinitionCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            5
        );
    }
575012
public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition('joomla.factory.database.driver.doctrine')) {
            return;
        }

        $doctrineFactory = $container->getDefinition('joomla.factory.database.driver.doctrine');
        $taggedServices = $container->findTaggedServiceIds('joomla.database');

        foreach (array_keys($taggedServices) as $id) {
            $platformDefinition = $container->getDefinition($id);
            $doctrineFactory->addMethodCall('addDatabasePlatform', [ $platformDefinition->getClass() ]);
        }

    }
578733
protected function prepareContainer(ContainerBuilder $container)
    {
        parent::prepareContainer($container);
        $container->setParameter('smart_core_cms.modules', $this->modules);
        $container->setParameter('smart_core_cms.site_name', $this->siteName);
    }
422473
public function process(ContainerBuilder $container)
    {
        // 1. Register custom repositories with Aggregate repository
        $aggregateRepositoryDefinition = $container->findDefinition(static::$aggregateRepositoryId);
        $customRepositoryTags = $container->findTaggedServiceIds(static::$customRepositoryTag);
        $customRepositoryReferences = [];

        foreach (array_keys($customRepositoryTags) as $id) {
            $customRepositoryReferences[] = new Reference($id);
        }

        $aggregateRepositoryDefinition->replaceArgument(1, $customRepositoryReferences);

        $topEzRepositoryAlias = $container->getAlias(static::$topEzRepositoryAliasId);

        // 2. Re-link eZ Platform's public top Repository alias
        $container->setAlias(static::$renamedTopEzRepositoryAliasId, (string)$topEzRepositoryAlias);

        // 3. Overwrite eZ Platform's public top Repository alias
        // to aggregate Repository implementation
        $container->setAlias(static::$topEzRepositoryAliasId, static::$aggregateRepositoryId);
    }
724701
public function process(ContainerBuilder $container)
    {
        $repositoryConfigurations = $container->getParameter('apisearch.repository_configuration');
        foreach ($repositoryConfigurations as $name => $repositoryConfiguration) {
            $this->createAppRepositories(
                $container,
                $name,
                $repositoryConfiguration
            );

            foreach ($repositoryConfiguration['indices'] as $indexName => $indexId) {
                $indexId = (string) $indexId;
                $this->createIndexRepositories(
                    $container,
                    $name,
                    $repositoryConfiguration,
                    $indexId,
                    $indexName
                );
            }
        }
    }
26343
public function build(ContainerBuilder $container)
    {
        $container->addCompilerPass(new CommandProcessorPass(), PassConfig::TYPE_BEFORE_REMOVING);
        $container->addCompilerPass(new PoolsPass());
        $container->addCompilerPass(new RegisterSerializerDriversPass());
        $container->addCompilerPass(new WorkerRunnersPass());
    }
277643
public function build(ContainerBuilder $container)
    {
        parent::build($container);

        $container->addCompilerPass(new SecurityPass());
        $container->addCompilerPass(new LegacyCachePurgerPass());
    }
289582
public function process(ContainerBuilder $container): void
    {
        $config = $this->getExtensionConfig($container);

        if ($container->hasDefinition('bkstg.core.filesystem.do_spaces')) {
            $container->getDefinition('sonata.media.metadata.amazon')
                ->addArgument([
                        'acl' => $config['filesystem']['acl'],
                        'storage' => $config['filesystem']['storage'],
                        'encryption' => $config['filesystem']['encryption'],
                        'meta' => $config['filesystem']['meta'],
                        'cache_control' => $config['filesystem']['cache_control'],
                ])
            ;
        }
    }
715258
public function prepend(ContainerBuilder $container)
    {
        $bundles = $container->getParameter('kernel.bundles');
        if (isset($bundles['DoctrineBundle'])) {
            // Get configuration of our own bundle
            $configs = $container->getExtensionConfig($this->getAlias());
            $config = $this->processConfiguration(new Configuration(), $configs);

            $edTargetEntities = array(
                'ED\BlogBundle\Interfaces\Model\BlogUserInterface' => $config['entities']['user_model_class'],
                'ED\BlogBundle\Interfaces\Model\BlogTermInterface' => $config['entities']['blog_term_class'],
                'ED\BlogBundle\Interfaces\Model\BlogTaxonomyInterface' => $config['entities']['blog_taxonomy_class'],
                'ED\BlogBundle\Interfaces\TaxonomyRelationsInterface' => $config['entities']['blog_taxonomy_relation_class'],
                'ED\BlogBundle\Interfaces\Model\ArticleInterface' => $config['entities']['article_class'],
                'ED\BlogBundle\Interfaces\Model\CommentInterface' => $config['entities']['blog_comment_class'],
                'ED\BlogBundle\Interfaces\Model\ArticleCommenterInterface' => $config['entities']['user_model_class'],
                'ED\BlogBundle\Interfaces\Model\ArticleMetaInterface' => $config['entities']['article_meta_class']
            );

            // Prepare for insertion
            $forInsertion = array(
                'orm' => array(
                    'resolve_target_entities' => $edTargetEntities,
                    'entity_managers' => array(
                        'default' => array(
                            'hydrators' => array(
                                'SettingsHydrator' => $config['hydrators']['settings_hydrator']
                            )
                        )
                    )
                ),
                'dbal' => array(
                    'types' => array(
                        'json' => 'Sonata\Doctrine\Types\JsonType'
                    )
                )
            );

            $container->setParameter('user_model_class', $config['entities']['user_model_class']);
            $container->setParameter('article_class', $config['entities']['article_class']);
            $container->setParameter('blog_comment_class', $config['entities']['blog_comment_class']);
            $container->setParameter('article_meta_class', $config['entities']['article_meta_class']);
            $container->setParameter('blog_settings_class', $config['entities']['blog_settings_class']);
            $container->setParameter('blog_taxonomy_class', $config['entities']['blog_taxonomy_class']);
            $container->setParameter('blog_term_class', $config['entities']['blog_term_class']);
            $container->setParameter('ed_blog.resolve_target_entities.config', $edTargetEntities);

        }

        if(isset($bundles['StofDoctrineExtensionsBundle'])) {
            $configs = $container->getExtensionConfig($this->getAlias());
            $config = $this->processConfiguration(new Configuration(), $configs);

            $stofConfigInsertation = array(
                'orm' => array(
                    'default' => array(
                        'sluggable' => true
                    )
                )
            );

        }


        foreach ($container->getExtensions() as $name => $extension) {
            switch ($name) {
                case 'doctrine':
                    if(isset($forInsertion)) {
                        $container->prependExtensionConfig($name, $forInsertion);
                    }
                    break;
                case 'stof_doctrine_extensions':
                    if(isset($stofConfigInsertation)){
                        $container->prependExtensionConfig($name, $stofConfigInsertation);
                    }
                    break;
            }
        }
    }
620887
public function prepend(ContainerBuilder $container)
    {
        $bundles = $container->getParameter('kernel.bundles');

        if (true === isset($bundles['TwigBundle'])) {
            $this->configureTwigBundle($container);
        }
        if (true === isset($bundles['FMElfinderBundle'])) {
            $this->configureFMElfinderBundle($container);
        }
    }
1252491
public function build(ContainerBuilder $container)
    {
        $container->addCompilerPass(
            new GenericCompilerPass(
                AttributeTypeRegistry::class,
                'sidus.attribute_type',
                'addType'
            )
        );
        $container->addCompilerPass(
            new GenericCompilerPass(
                AttributeRegistry::class,
                'sidus.attribute',
                'addAttribute'
            )
        );
        $container->addCompilerPass(
            new GenericCompilerPass(
                FamilyRegistry::class,
                'sidus.family',
                'addFamily'
            )
        );
    }