Load repository

@param XmlFileLoader $loader
@param ContainerBuilder $container
@param array $config
@throws \Exception
769095
protected function loadRepository($loader, ContainerBuilder $container, array $config)
    {
        if (isset($config['repository']['type'])) {
            if ($config['repository']['type'] == 'yaml') {
                if (!isset($config['repository']['repo']['filename'])) {
                    throw new InvalidConfigurationException(
                        'You must define filename parameter for repo yaml repository'
                    );
                }
                $container->setParameter(
                    'snide_travinizer.repo_repository.filename',
                    $config['repository']['repo']['filename']
                );
            }

            $loader->load('repository/' . strtr($config['repository']['type'], '_', '/') . '.xml');
        } else {
            throw new InvalidConfigurationException('You must define repository type parameter');
        }

        if (isset($config['repository']['class'])) {
            $container->setParameter('snide_travinizer.repo_repository.class', $config['repository']['class']);
        }
    }
248480
public function loadConfiguration(ConfigurationLoader $loader, array $params = [])
	{
		try
		{
			$data = $loader->findLoader($this->source)->load($this->source, $params);
			
			return new Configuration($this->createBase($data));
		}
		catch(\Exception $e)
		{
			throw new ConfigurationLoadingException(sprintf('Unable to load config from source "%s"', $this->source->getPathname()), 0, $e);
		}
	}
1001091
public function load(array $config, ContainerBuilder $container)
    {
        $configs[] = $this->options;
        $configuration = $this->getConfiguration($configs, $container);
        $config = $this->processConfiguration($configuration, $configs);

        $container->setParameter('twig.template_dir', $config['template_dir']);

        $container->register('twig.asset_extension', 'Nice\Twig\AssetExtension')
            ->addArgument(new Reference('service_container'))
            ->addTag('twig.extension');

        $container->register('twig.router_extension', 'Nice\Twig\RouterExtension')
            ->addArgument(new Reference('service_container'))
            ->addTag('twig.extension');

        $container->register('twig.loader', 'Twig_Loader_Filesystem')
            ->addArgument(array('%twig.template_dir%'));

        $container->register('twig', 'Twig_Environment')
            ->addArgument(new Reference('twig.loader'));

        $container->register('templating.engine.twig', 'Nice\Templating\TwigEngine')
            ->addArgument(new Reference('twig'))
            ->addArgument(new Reference('templating.template_name_parser'))
            ->addTag('templating.engine');
    }
465013
protected function loadConfiguration(ContainerBuilder $container)
    {
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . "/../Config/Resources"));
        $finder = Finder::create()
            ->name('*.xml')
            ->depth(0)
            ->in(__DIR__ . "/../Config/Resources");

        /** @var \SplFileInfo $file */
        foreach ($finder as $file) {
            $loader->load($file->getBaseName());
        }

        if (\defined("THELIA_INSTALL_MODE") === false) {
            $modules = ModuleQuery::getActivated();

            $translationDirs = array();



            /** @var Module $module */
            foreach ($modules as $module) {
                try {
                    $definition = new Definition();
                    $definition->setClass($module->getFullNamespace());
                    $definition->addMethodCall("setContainer", array(new Reference('service_container')));

                    $container->setDefinition(
                        "module." . $module->getCode(),
                        $definition
                    );

                    $compilers = \call_user_func(array($module->getFullNamespace(), 'getCompilers'));

                    foreach ($compilers as $compiler) {
                        if (\is_array($compiler)) {
                            $container->addCompilerPass($compiler[0], $compiler[1]);
                        } else {
                            $container->addCompilerPass($compiler);
                        }
                    }

                    $loader = new XmlFileLoader($container, new FileLocator($module->getAbsoluteConfigPath()));
                    $loader->load("config.xml", "module." . $module->getCode());

                    $envConfigFileName = sprintf("config_%s.xml", $this->environment);
                    $envConfigFile = sprintf('%s%s%s', $module->getAbsoluteConfigPath(), DS, $envConfigFileName);

                    if (is_file($envConfigFile) && is_readable($envConfigFile)) {
                        $loader->load($envConfigFileName, "module." . $module->getCode());
                    }
                } catch (\Exception $e) {
                    Tlog::getInstance()->addError(
                        sprintf("Failed to load module %s: %s", $module->getCode(), $e->getMessage()),
                        $e
                    );
                }
            }

            $parser = $container->getDefinition('thelia.parser');

            /** @var \Thelia\Core\Template\TemplateHelperInterface $templateHelper */
            $templateHelper = $container->get('thelia.template_helper');

            /** @var Module $module */
            foreach ($modules as $module) {
                try {
                    $this->loadModuleTranslationDirectories($module, $translationDirs, $templateHelper);

                    $this->addStandardModuleTemplatesToParserEnvironment($parser, $module);
                } catch (\Exception $e) {
                    Tlog::getInstance()->addError(
                        sprintf("Failed to load module %s: %s", $module->getCode(), $e->getMessage()),
                        $e
                    );
                }
            }

            // Load core translation
            $translationDirs['core'] = THELIA_LIB . 'Config' . DS . 'I18n';

            // Load core translation
            $translationDirs[Translator::GLOBAL_FALLBACK_DOMAIN] = THELIA_LOCAL_DIR . 'I18n';

            // Standard templates (front, back, pdf, mail)
            /** @var TemplateDefinition $templateDefinition */
            foreach ($templateHelper->getStandardTemplateDefinitions() as $templateDefinition) {
                // Load parent templates transaltions, the current template translations.
                $templateList = array_merge(
                    $templateDefinition->getParentList(),
                    [ $templateDefinition ]
                );

                /** @var TemplateDefinition $tplDef */
                foreach ($templateList as $tplDef) {
                    if (is_dir($dir = $tplDef->getAbsoluteI18nPath())) {
                        $translationDirs[$tplDef->getTranslationDomain()] = $dir;
                    }
                }
            }

            if ($translationDirs) {
                $this->loadTranslation($container, $translationDirs);
            }
        }
    }
17482
public function loadOrmProvider($config, XmlFileLoader $loader, ContainerBuilder $container)
    {
        $container->setParameter($this->getAlias() . '.persistence.orm.manager_name', $config['manager_name']);
        $container->setParameter($this->getAlias() . '.backend_type_orm', true);
        $loader->load('persistence-orm.xml');
    }
286452
private function handleCache(array $config, ContainerBuilder $container, FileLoader $loader)
    {
        $loader->load('cache.yml');

        $purgeService = null;
        if (isset($config['http_cache']['purge_type'])) {
            $container->setParameter('ezpublish.http_cache.purge_type', $config['http_cache']['purge_type']);
        }
    }
646855
public function load (array $config, ContainerBuilder $container)
    {
        // parse configuration
        $parsedConfiguration = $this->processConfiguration(new Configuration(), $config);

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

        // build role collection
        $builder = new RoleCollectionBuilder();

        $roleCollectionDefinition = $container->getDefinition("becklyn.static_roles.role_collection");
        $roleCollectionDefinition->replaceArgument(0, $builder->prepareRoleCollection($parsedConfiguration["roles"]));
    }
798670
public function load(ContainerBuilder $container, array $config)
    {
        $this->loadPauser($container);
        $this->loadController($container);
        $this->loadListener($container);
    }
1278321
public function load(array $configs, ContainerBuilder $container)
    {
        $fileSrc = dirname($this->reflector->getFileName()) . $this->xmlFilePath;
        $loader  = new XmlFileLoader($container, new FileLocator($fileSrc));
        $loader->load($this->xmlFileName);
    }
450872
private function loadLockingComponent(array $config, ContainerBuilder $container, LoaderInterface $loader)
    {
        if (!$config['enabled']) {
            return $loader->load('locking/null.xml');
        }

        $loader->load('locking/services.xml');
        $container->setParameter('task.lock.ttl', $config['ttl']);
    }
879841
public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

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

        if (array_key_exists('apple', $config)) {
            $this->buildApple($loader, $container, $config['apple'], $config['connection_handler']);
        }

        if (array_key_exists('android', $config)) {
            $this->buildAndroid($loader, $container, $config['android'], $config['connection_handler']);
        }

        if (array_key_exists('windows', $config)) {
            $this->buildWindows($loader, $container, $config['windows'], $config['connection_handler']);
        }
    }
1189455
public function load(array $configs, ContainerBuilder $container)
    {
        // Load DoctrineRiakBundle/Resources/config/riak.xml
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('riak.xml');

        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        if (empty($config['default_connection'])) {
            $keys = array_keys($config['connections']);
            $config['default_connection'] = reset($keys);
        }
        $container->setParameter('doctrine_riak.odm.default_connection', $config['default_connection']);

        if (empty($config['default_document_manager'])) {
            $keys = array_keys($config['document_managers']);
            $config['default_document_manager'] = reset($keys);
        }
        $container->setParameter('doctrine_riak.odm.default_document_manager', $config['default_document_manager']);

        // set some options as parameters and unset them
        $config = $this->overrideParameters($config, $container);

        // load the connections
        $this->loadConnections($config['connections'], $container);

        // load the document managers
        $this->loadDocumentManagers(
            $config['document_managers'],
            $config['default_document_manager'],
            $config['default_database'],
            $container
        );

        if ($config['resolve_target_documents']) {
            $def = $container->findDefinition('doctrine_riak.odm.listeners.resolve_target_document');
            foreach ($config['resolve_target_documents'] as $name => $implementation) {
                $def->addMethodCall('addResolveTargetDocument', array($name, $implementation, array()));
            }
            $def->addTag('doctrine_riak.odm.event_listener', array('event' => 'loadClassMetadata'));
        }

        // BC Aliases for Document Manager
        //$container->setAlias('doctrine.odm.riak.document_manager', new Alias('doctrine_riak.odm.document_manager'));
    }
287301
public function loadInternal(array $configs, ContainerBuilder $container): void
    {
        $file = $this->getServiceName();
        if (!file_exists($file)) {
            throw new BadMethodCallException('"'.$file.'" doesn\'t exist!');
        }
        $parts = pathinfo($file);

        switch ($parts['extension']) {
            case 'xml':
                $loader = new XmlFileLoader($container, new FileLocator($parts['dirname']));
            break;
            case 'yml':
            case 'yaml':
                $loader = new YamlFileLoader($container, new FileLocator($parts['dirname']));
                break;
            default:
                throw new BadMethodCallException(
                    'This extension does not accept ".'
                    .$parts['extension']
                    .'" extension, only ".yml", ".yaml" or ".xml"!'
                );
        }
        $loader->load($parts['basename']);
        $this->setConfigParameters($configs, $container);
    }
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);
    }
310205
public function load(array $config, ContainerBuilder $container)
    {
        $loader = new YamlFileLoader(
            $container,
            new FileLocator(__DIR__ . '/../Resources/config')
        );

        // Base services override
        $loader->load('services.yml');
    }
985771
public function loadInternal(array $config, ContainerBuilder $container)
    {
        $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
        $loader->load('services.yml');

        $bundles = $container->getParameter('kernel.bundles');

        $directories = [];
        if ($config['metadata']['auto_detection']) {
            foreach ($bundles as $name => $class) {
                $ref                                   = new \ReflectionClass($class);
                $directories[$ref->getNamespaceName()] = dirname($ref->getFileName()) . '/Resources/config/fixture';
            }
        }

        foreach ($config['metadata']['directories'] as $directory) {
            $directory['path'] = rtrim(str_replace('\\', '/', $directory['path']), '/');
            if ('@' === $directory['path'][0]) {
                preg_match('~^@([a-z0-9_]+)~i', $directory['path'], $match);

                if (isset($match[1])) {
                    list($prefixedBundleName, $bundleName) = $match;
                    if (!isset($bundles[$bundleName])) {
                        throw new RuntimeException(sprintf('The bundle "%s" has not been registered with AppKernel. Available bundles: %s', $bundleName, implode(', ', array_keys($bundles))));
                    }
                    $ref = new \ReflectionClass($bundles[$bundleName]);
                    $directory['path'] = dirname($ref->getFileName()).substr($directory['path'], strlen($prefixedBundleName));
                }
            }
            $directories[rtrim($directory['namespace_prefix'], '\\')] = rtrim($directory['path'], '\\/');
        }

        $container
            ->getDefinition('trappar_alice_generator.metadata.file_locator')
            ->addArgument($directories);

        $container
            ->getDefinition(YamlWriter::class)
            ->addArgument($config['yaml']['inline'])
            ->addArgument($config['yaml']['indent']);

        $container
            ->getDefinition(ValueVisitor::class)
            ->addArgument($config['strictTypeChecking']);
    }
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');
        }
    }