Handle public API loading.

@param \Symfony\Component\DependencyInjection\ContainerBuilder $container
@param \Symfony\Component\DependencyInjection\Loader\FileLoader $loader
966723
private function handleApiLoading(ContainerBuilder $container, FileLoader $loader)
    {
        // Loading configuration from Core/settings
        $coreLoader = new Loader\YamlFileLoader(
            $container,
            new FileLocator(__DIR__ . '/../../../Publish/Core/settings')
        );
        $coreLoader->load('repository.yml');
        $coreLoader->load('repository/inner.yml');
        $coreLoader->load('repository/signalslot.yml');
        $coreLoader->load('repository/siteaccessaware.yml');
        $coreLoader->load('fieldtype_external_storages.yml');
        $coreLoader->load('fieldtypes.yml');
        $coreLoader->load('indexable_fieldtypes.yml');
        $coreLoader->load('roles.yml');
        $coreLoader->load('storage_engines/common.yml');
        $coreLoader->load('storage_engines/cache.yml');
        $coreLoader->load('storage_engines/legacy.yml');
        $coreLoader->load('storage_engines/shortcuts.yml');
        $coreLoader->load('search_engines/common.yml');
        $coreLoader->load('utils.yml');
        $coreLoader->load('io.yml');
        $coreLoader->load('policies.yml');
        $coreLoader->load('notification.yml');
        $coreLoader->load('user_preference.yml');

        // Load Core RichText settings
        if (!$this->isRichTextBundleEnabled($container)) {
            $coreLoader->load('richtext.yml');
        }

        // Public API services
        $loader->load('papi.yml');

        // Built-in field types
        $loader->load('fieldtype_services.yml');

        // Storage engine
        $loader->load('storage_engines.yml');

        // Load CoreBundle RichText settings
        if (!$this->isRichTextBundleEnabled($container)) {
            $loader->load('richtext.yml');
        }
    }
837678
public function build(ContainerBuilder $container)
    {
        parent::build($container);

        $container->addCompilerPass(new ValidatorPass());
        $container->addCompilerPass(new FormPass());
        $container->addCompilerPass(new TwigLoaderPass());
    }
246536
public function build(ContainerBuilder $container)
    {
        parent::build($container);

        $container->addCompilerPass(
            new DependencyInjection\Compiler\EventPropagationPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION
        );
    }
550234
protected function loadConfiguration(ContainerBuilder $container, array $config)
    {
        $container->setParameter('jb_fileuploader.endpoints', $config);
        $container->setParameter('jb_fileuploader.crop_route', $config['crop_route']);
    }
600371
private function loadGherkin(ContainerBuilder $container)
    {
        $definition = new Definition('Behat\Gherkin\Gherkin');
        $container->setDefinition(self::MANAGER_ID, $definition);
    }
310205
public function load(array $config, ContainerBuilder $container)
    {
        $loader = new YamlFileLoader(
            $container,
            new FileLocator(__DIR__ . '/../Resources/config')
        );

        // Base services override
        $loader->load('services.yml');
    }
603168
public function loader(callable $loader, string ...$types): BuilderInterface
    {
        $this->resolver->loader($loader, ...$types);

        return $this;
    }
1327221
protected function postLoad(array $config, ContainerBuilder $container)
    {
        parent::postLoad($config, $container);

        $locatorProviderId = $config['location']['provider_adapter'];
        $container->setAlias('elcodi.location_provider', $locatorProviderId);

        $locatorPopulatorAdapterId = $config['location']['populator_adapter'];
        $container->setAlias('elcodi.location_populator_adapter', $locatorPopulatorAdapterId);

        $locatorLoaderAdapterId = $config['location']['loader_adapter'];
        $container->setAlias('elcodi.location_loader_adapter', $locatorLoaderAdapterId);
    }
818390
public function load(ContainerBuilder $container, array $config)
    {
        $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Config'));
        $loader->load('services.yml');
        $container->setParameter(Extension::SERVICE_NAME . '.selected_factory', $config['type']);
        $container->setParameter(Extension::SERVICE_NAME . '.configuration', $config['configuration']);
    }
294609
public function loadServices(ContainerBuilder $container)
    {
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/config'));
        $loader->load('services.xml');
        $this->imageDrivers = $this->driverLocator->findDrivers(
            $container,
            $this->imageDriverKeys,
            $this->imageDriverConfigs
        );
    }
923083
protected function loadRootNodeListener(ContainerBuilder $container)
    {
        $definition = new Definition('Behat\Behat\Output\Node\EventListener\AST\StepListener', array(
            new Reference('output.node.printer.progress.step')
        ));
        $container->setDefinition(self::ROOT_LISTENER_ID, $definition);
    }
49255
public function getFileLoader(ContainerBuilder $container)
    {
        if (!$this->loader) {
            $this->loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../../Resources/config'));
        }

        return $this->loader;
    }
889060
private function loadSuiteSetup(ContainerBuilder $container)
    {
        $definition = new Definition('Behat\Behat\Context\Suite\Setup\SuiteWithContextsSetup', array(
            new Reference(AutoloaderExtension::CLASS_LOADER_ID),
            new Reference(FilesystemExtension::LOGGER_ID)
        ));
        $definition->addTag(SuiteExtension::SETUP_TAG, array('priority' => 20));
        $container->setDefinition(self::getSuiteSetupId(), $definition);
    }
1360038
private function loadCore(ContainerBuilder $container, Loader\YamlFileLoader $loader, $config)
    {
        $isCacheEnabled = $config['metadata_cache'];

        $container->setParameter('ma27_api_key_authentication.model_name', $config['model_name']);
        $container->setParameter('ma27_api_key_authentication.object_manager', $config['object_manager']);
        $container->setParameter('ma27_api_key_authentication.property.apiKeyLength', $config['api_key_length']);
        $container->setParameter('ma27_api_key_authentication.metadata_cache_enabled', $isCacheEnabled);

        if ($isCacheEnabled) {
            $loader->load('metadata_cache_warmer.yml');
        }

        $this->loadPassword($container, $config['password'], $loader);
    }
296939
public function process(ContainerBuilder $container)
    {
        $loaderTags = $container->findTaggedServiceIds('majora.loader');

        foreach ($loaderTags as $loaderId => $tags) {
            $loaderDefinition = $container->getDefinition($loaderId);
            $loaderReflection = new \ReflectionClass($loaderDefinition->getClass());

            foreach ($tags as $attributes) {
                $method = $loaderReflection->implementsInterface(LoaderInterface::class) ?
                    'configureMetadata' : ($loaderReflection->hasMethod('setUp') ?
                        'setUp' : ''
                    )
                ;
                if (isset($attributes['entityClass']) || isset($attributes['entityCollection'])) {
                    @trigger_error('"entityClass" and "entityCollection" attributes for tag "majora.loader" are deprecated and will be removed in 2.0. Please "entity" and "collection" instead.', E_USER_DEPRECATED);
                }
                $entityClass = isset($attributes['entity']) ? $attributes['entity'] : $attributes['entityClass'];
                $collectionClass = isset($attributes['collection']) ? $attributes['collection'] : $attributes['entityCollection'];
                $entityReflection = new \ReflectionClass($entityClass);

                // configureMetadata() call configuration
                if ($method) {
                    if (!$entityReflection->implementsInterface(CollectionableInterface::class)) {
                        throw new \InvalidArgumentException(sprintf(
                            'Cannot support "%s" class into "%s" : managed items have to be %s.',
                            $entityClass,
                            $loaderDefinition->getClass(),
                            CollectionableInterface::class
                        ));
                    }
                    $arguments = array(
                        $entityClass,
                        array_map(
                            function ($property) { return $property->getName(); },
                            $entityReflection->getProperties()
                        ),
                        $collectionClass,
                    );

                    $loaderDefinition->addMethodCall($method, $arguments);
                }

                // Doctrine case
                if ($loaderReflection->isSubclassOf(AbstractDoctrineLoader::class)) {

                    // "repository" attribute key only supported for doctrine loaders
                    // Repository is injected through mutator to avoid circular references
                    // with Doctrine events and connection
                    if (isset($attributes['repository'])) {
                        $loaderDefinition->addMethodCall(
                            'setEntityRepository',
                            array(new Reference($attributes['repository']))
                        );
                    }

                    // for Doctrine, loaders cannot self enable objects lazy loading
                    // due to general event trigger into all listener for each entites
                    // so we have to check class / attribute and register service into event proxy
                    if ($container->hasDefinition('majora.doctrine.event_proxy') && !empty($attributes['lazy'])) {
                        if (!$entityReflection->implementsInterface(LazyPropertiesInterface::class)) {
                            throw new \InvalidArgumentException(sprintf(
                                'Class %s has to implement %s to be able to lazy load her properties.',
                                $entityClass,
                                LazyPropertiesInterface::class
                            ));
                        }
                        $container->getDefinition('majora.doctrine.event_proxy')
                            ->addMethodCall('registerDoctrineLazyLoader', array(
                                $entityClass,
                                new Reference($loaderId),
                            ))
                        ;
                    }
                }
            }
        }
    }
754956
private function handleRouting(array $config, ContainerBuilder $container, FileLoader $loader)
    {
        $loader->load('routing.yml');
        $container->setAlias('router', 'ezpublish.chain_router');

        if (isset($config['router']['default_router']['non_siteaccess_aware_routes'])) {
            $container->setParameter(
                'ezpublish.default_router.non_siteaccess_aware_routes',
                array_merge(
                    $container->getParameter('ezpublish.default_router.non_siteaccess_aware_routes'),
                    $config['router']['default_router']['non_siteaccess_aware_routes']
                )
            );
        }
    }
922620
protected function initializeFileLoader(FileLoader $fileLoader = null)
    {
        if (!isset($this->fileLoader)) {
            $this->setFileLoader(($fileLoader) ? $fileLoader : new FileLoader());
        }
    }