Configure the geolocator services.

@param array $config - Resolved configuration
@param ContainerBuilder
182214
private function configureGeolocators($config, $container)
    {
        $geolocatorName = $config['geolocator'];
        $container->setParameter('sulu_location.geolocator.name', $geolocatorName);

        $nominatim = function($config, $container) {
            $endpoint = $config['geolocators']['nominatim']['endpoint'];
            $container->setParameter('sulu_location.geolocator.service.nominatim.endpoint', $endpoint);
        };

        $google = function($config, $container) {
            $apiKey = $config['geolocators']['google']['api_key'];
            $container->setParameter('sulu_location.geolocator.service.google.api_key', $apiKey);
        };

        $nominatim($config, $container);
        $google($config, $container);
    }
205262
protected function process(array $config, ContainerBuilder $container)
    {
        $container->setParameter('qcm_core.website_name', $config['website_name']);
        $container->setParameter('qcm.model.user.class', $config['user_class']);
        $container->setParameter('qcm.configuration', $config['configuration']);
        $container->setParameter('qcm_core.statistics.class', $config['service']['statistics']['class']);
        $container->setParameter('qcm_core.template.class', $config['service']['statistics']['template']);

        $container->setAlias('qcm.configuration', $config['service']['configuration']);
        $container->setAlias('qcm.user_session_configuration', $config['service']['user_session_configuration']);

        return $config;
    }
1291658
public function configureMultisite(ContainerBuilder $container, array $config)
    {
        $multisite = $config['multisite'];

        if ('host' === $multisite) {
            $container->setAlias('sonata.page.site.selector', 'sonata.page.site.selector.host');

            $container->removeDefinition('sonata.page.site.selector.host_by_locale');
            $container->removeDefinition('sonata.page.site.selector.host_with_path');
            $container->removeDefinition('sonata.page.site.selector.host_with_path_by_locale');
        } elseif ('host_by_locale' === $multisite) {
            $container->setAlias('sonata.page.site.selector', 'sonata.page.site.selector.host_by_locale');

            $container->removeDefinition('sonata.page.site.selector.host');
            $container->removeDefinition('sonata.page.site.selector.host_with_path');
            $container->removeDefinition('sonata.page.site.selector.host_with_path_by_locale');
        } else {
            /*
             * The multipath option required a specific router and RequestContext
             */
            $container->setAlias('router.request_context', 'sonata.page.router.request_context');

            if ('host_with_path' === $multisite) {
                $container->setAlias('sonata.page.site.selector', 'sonata.page.site.selector.host_with_path');

                $container->removeDefinition('sonata.page.site.selector.host_with_path_by_locale');
                $container->removeDefinition('sonata.page.site.selector.host');
                $container->removeDefinition('sonata.page.site.selector.host_by_locale');
            } elseif ('host_with_path_by_locale' === $multisite) {
                $container->setAlias('sonata.page.site.selector', 'sonata.page.site.selector.host_with_path_by_locale');

                $container->removeDefinition('sonata.page.site.selector.host_with_path');
                $container->removeDefinition('sonata.page.site.selector.host');
                $container->removeDefinition('sonata.page.site.selector.host_by_locale');
            }
        }

        if ($container->hasAlias('sonata.page.site.selector')) {
            $container->getAlias('sonata.page.site.selector')->setPublic(true);
        }
    }
692233
public function load(ContainerBuilder $container, array $config)
    {
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/config'));
        $loader->load('services.xml');

        if (!empty($config['path'])) {
            if (isset($config['path']['resources'])) {
                $container->setParameter('paths.resources.resource', $config['path']['resources']);
            }

            if (isset($config['path']['base'])) {
                $container->setParameter('paths.resources.base', $config['path']['base']);
            }
        }

        if (!empty($config['resource_map'])) {
            $container->setParameter('resource.map', $config['resource_map']);
        }
    }
73819
public function load(ContainerBuilder $container, array $config)
    {
        $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/config'));
        $loader->load('services.yml');

        // Backwards compatibility for pre-1.0. Will be removed in 2.0.
        if ($config['default_driver'] === 'wpapi') {
            $config['default_driver'] = 'wpphp';
        }

        $container->setParameter('wordpress.wordpress.default_driver', $config['default_driver']);
        $container->setParameter('wordpress.path', $config['path']);
        $container->setParameter('wordpress.parameters', $config);

        $this->setupWpcliDriver($loader, $container, $config);
        $this->setupWpphpDriver($loader, $container, $config);
        $this->setupBlackboxDriver($loader, $container, $config);
    }
40342
private function configureWebpackAssets(ContainerBuilder $container, array $config): void
    {
        $assetsFile = $config['file'];
        $cacheId = $config['cache']['service_id'];
        $cacheKey = $config['cache']['key'];
        $cacheEnabled = $config['cache']['enabled'];
        $cacheEnabled = null !== $cacheEnabled
            ? $cacheEnabled
            : !$container->getParameter('kernel.debug');

        $container->setParameter('fxp_require_asset.webpack.adapter.assets.file', $assetsFile);
        $container->setParameter('fxp_require_asset.webpack.adapter.assets.cache_key', $cacheKey);

        if ($cacheEnabled) {
            $container->setAlias('fxp_require_asset.webpack.adapter.assets.cache', $cacheId);
        }
    }
99336
public function configureTemplatesAdmin(ContainerBuilder $container, array $config)
    {
        $templateManager = $container->getDefinition('sonata.page.admin.page');

        $definitions = $config['templates_admin'];

        $templateManager->addMethodCall('setTemplates', [$definitions]);
    }
449072
private function loadElasticsearch(array $config, ContainerBuilder $container): void
    {
        $pass = new CollectorCompilerPass('pucene.elasticsearch.visitor', 'pucene.elasticsearch.visitor_pool', 'query');
        $pass->process($container);
    }
823549
protected function postLoad(array $config, ContainerBuilder $container)
    {
        parent::postLoad($config, $container);

        $container->setAlias(
            'elcodi.media_resize_adapter',
            $config['images']['resize']['adapter']
        );

        $container->setAlias(
            'elcodi.media_filesystem',
            $container->getParameter('elcodi.media_filesystem_service')
        );
    }
879565
private function configureSerializer(array $config, ContainerBuilder $container): void
    {
        if ($config['metadata_factory']) {
            $container->setAlias('fivelab.resource.serializer.metadata_factory', $config['metadata_factory']);
        }

        if ($config['name_converter']) {
            $container->setAlias('fivelab.resource.serializer.name_converter', $config['name_converter']);
        }

        if ($config['property_accessor']) {
            $container->setAlias('fivelab.resource.serializer.property_accessor', $config['property_accessor']);
        }

        if ($config['property_info']) {
            $container->setAlias('fivelab.resource.serializer.property_info', $config['property_info']);
        }

        if ($config['event_dispatcher']) {
            $container->setAlias('fivelab.resource.serializer.event_dispatcher', $config['event_dispatcher']);
        }

        $container->setParameter('fivelab.resource.serializer.serialize_null', $config['serialize_null']);
    }
755664
public function configureController($config, ContainerBuilder $container)
    {
        $container->setParameter('bruery.oauth_server.admin.access_token.controller',   $config['admin']['access_token']['controller']);
        $container->setParameter('bruery.oauth_server.admin.client.controller',         $config['admin']['client']['controller']);
    }
179540
public function getConfiguration(array $config, ContainerBuilder $container)
    {
        $configuration = parent::getConfiguration($config, $container);
        if (null === $configuration) {
            throw new \RuntimeException('No configuration found');
        }

        return $configuration;
    }
309864
public function load(ContainerBuilder $container, array $config)
    {
        if (isset($config['connection_details'])) {
            DEFINE('SQLDBENGINE', $config['connection_details']['engine']);
            DEFINE('SQLDBHOST', $config['connection_details']['host']);
            DEFINE('SQLDBSCHEMA', $config['connection_details']['schema']);
            DEFINE('SQLDBNAME', $config['connection_details']['dbname']);
            DEFINE('SQLDBUSERNAME', $config['connection_details']['username']);
            DEFINE('SQLDBPASSWORD', $config['connection_details']['password']);
            DEFINE('SQLDBPREFIX', $config['connection_details']['dbprefix']);
            session_start();
            // Store any keywords set in behat.yml file
            if (isset($config['keywords']) and $config['keywords']) {
                foreach ($config['keywords'] as $keyword => $value) {
                    $_SESSION['behat']['GenesisSqlExtension']['keywords'][$keyword] = $value;
                }
            }

            // Set 'notQuotableKeywords' for later use.
            $_SESSION['behat']['GenesisSqlExtension']['notQuotableKeywords'] = [];

            if (isset($config['notQuotableKeywords'])) {
                $_SESSION['behat']['GenesisSqlExtension']['notQuotableKeywords'] = $config['notQuotableKeywords'];
            }
        }
    }
210209
private function configurePlugins(ContainerBuilder $container, array $config)
    {
        if (!empty($config['authentication'])) {
            $this->configureAuthentication($container, $config['authentication']);
        }
        unset($config['authentication']);

        foreach ($config as $name => $pluginConfig) {
            $pluginId = 'httplug.plugin.'.$name;

            if ($this->isConfigEnabled($container, $pluginConfig)) {
                $def = $container->getDefinition($pluginId);
                $this->configurePluginByName($name, $def, $pluginConfig, $container, $pluginId);
            }
        }
    }
220317
public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $processedConfiguration = $this->processConfiguration($configuration, $configs);
        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
        $loader->load('services.xml');

        $this->passConfigurationToOptions($container, $processedConfiguration);

        $container->getDefinition(ClientBuilderInterface::class)
            ->setConfigurator([ClientBuilderConfigurator::class, 'configure']);

        foreach ($processedConfiguration['listener_priorities'] as $key => $priority) {
            $container->setParameter('sentry.listener_priorities.' . $key, $priority);
        }

        $this->tagConsoleErrorListener($container);
    }
367058
private function registerClients(array $config, ContainerBuilder $container)
    {
        foreach ($config['clients'] as $clientType => $clients) {
            $clientFQCN = ($clientType == 'apns') ? 'LinkValue\MobileNotifBundle\Client\ApnsClient' : 'LinkValue\MobileNotifBundle\Client\GcmClient';

            foreach ($clients as $clientName => $clientConfig) {
                $params = isset($clientConfig['params']) ? $clientConfig['params'] : array();
                $services = isset($clientConfig['services']) ? $clientConfig['services'] : array();

                // The final client name is a concatenation of the client type (apns/gcm) and the client name (defined by user) separated by a point '.'
                $clientName = sprintf('%s.%s', $clientType, $clientName);

                // Register client with required stuff
                $client = $container->register(sprintf('link_value_mobile_notif.clients.%s', $clientName), $clientFQCN)
                    ->addMethodCall('setUp', array($params))
                    ->addTag('link_value_mobile_notif.client', array('name' => $clientName))
                ;

                // Set optional logger
                if(!empty($services['logger'])) {
                    $client->addMethodCall('setLogger', array(new Reference($services['logger'])));
                }

                // Set optional profiler
                if(!empty($services['profiler'])) {
                    $client->addMethodCall('setClientProfiler', array(new Reference($services['profiler'])));
                }
            }
        }
    }
766197
public function configureClass($config, ContainerBuilder $container)
    {
        // admin configuration
        $container->setParameter('networking_init_cms.admin.page.class', $config['class']['page']);
        $container->setParameter('networking_init_cms.admin.layout_block.class', $config['class']['layout_block']);
        $container->setParameter('networking_init_cms.admin.user.class', $config['class']['user']);

        // manager configuration
        $container->setParameter('networking_init_cms.manager.page.class', $config['class']['page']);
        $container->setParameter('networking_init_cms.manager.layout_block.class', $config['class']['layout_block']);
        $container->setParameter('networking_init_cms.manager.user.class', $config['class']['user']);

        switch ($config['db_driver']) {
            case 'orm':
                $container->setParameter('networking_init_cms.admin.layout_block.class', 'Networking\InitCmsBundle\Entity\LayoutBlock');
                break;
            case 'mongodb':
                $container->setParameter('networking_init_cms.admin.layout_block.class', 'Networking\InitCmsBundle\Docment\LayoutBlock');
                break;
            default:
                throw new \InvalidArgumentException('db driver must be either orm or mongodb');
                break;
        }
    }