LoaderResolver example

$callback(new ContainerConfigurator($container$bundleLoader$instanceof$file$file$env));
        } finally {
            $instanceof = [];
            $bundleLoader->registerAliasesForSinglyImplementedInterfaces();
        }
    }

    private function createContainerLoader(ContainerBuilder $container, string $env): DelegatingLoader
    {
        $buildDir = $container->getParameter('kernel.build_dir');
        $locator = new FileLocator();
        $resolver = new LoaderResolver([
            new XmlFileLoader($container$locator$env),
            new YamlFileLoader($container$locator$env),
            new IniFileLoader($container$locator$env),
            new PhpFileLoader($container$locator$envnew ConfigBuilderGenerator($buildDir)),
            new GlobFileLoader($container$locator$env),
            new DirectoryLoader($container$locator$env),
            new ClosureLoader($container$env),
        ]);

        return new DelegatingLoader($resolver);
    }
}
$cache->write($rootCode$container->getResources());
    }

    /** * Returns a loader for the container. */
    protected function getContainerLoader(ContainerInterface $container): DelegatingLoader
    {
        $env = $this->getEnvironment();
        $locator = new FileLocator($this);
        $resolver = new LoaderResolver([
            new XmlFileLoader($container$locator$env),
            new YamlFileLoader($container$locator$env),
            new IniFileLoader($container$locator$env),
            new PhpFileLoader($container$locator$envclass_exists(ConfigBuilderGenerator::class) ? new ConfigBuilderGenerator($this->getBuildDir()) : null),
            new GlobFileLoader($container$locator$env),
            new DirectoryLoader($container$locator$env),
            new ClosureLoader($container$env),
        ]);

        return new DelegatingLoader($resolver);
    }

    


    protected function createContainerExtension(): ?ExtensionInterface
    {
        return new ElasticsearchExtension();
    }

    private function buildConfig(ContainerBuilder $container): void
    {
        $locator = new FileLocator('Resources/config');

        $resolver = new LoaderResolver([
            new XmlFileLoader($container$locator),
            new YamlFileLoader($container$locator),
            new IniFileLoader($container$locator),
            new PhpFileLoader($container$locator),
            new GlobFileLoader($container$locator),
            new DirectoryLoader($container$locator),
            new ClosureLoader($container),
        ]);

        $configLoader = new DelegatingLoader($resolver);

        
public function build(ContainerBuilder $container): void
    {
        parent::build($container);

        $container->addCompilerPass(new TwigEnvironmentCompilerPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, 0);

        $loader = new XmlFileLoader($containernew FileLocator(__DIR__ . '/DependencyInjection'));
        $loader->load('services.xml');

        $locator = new FileLocator($this->getPath() . '/Resources/config');

        $resolver = new LoaderResolver([
            new YamlFileLoader($container$locator),
            new GlobFileLoader($container$locator),
        ]);

        $configLoader = new DelegatingLoader($resolver);

        $configLoader->load('{packages}/*.yaml', 'glob');
    }
}
parent::configureRoutes($routes$environment);
    }

    private function buildConfig(ContainerBuilder $container, string $environment): void
    {
        if (!InstalledVersions::isInstalled('symfony/web-profiler-bundle')) {
            return;
        }

        $locator = new FileLocator('Resources/config');

        $resolver = new LoaderResolver([
            new YamlFileLoader($container$locator),
            new GlobFileLoader($container$locator),
        ]);

        $configLoader = new DelegatingLoader($resolver);

        $confDir = $this->getPath() . '/Resources/config';

        $configLoader->load($confDir . '/{packages}/*' . Kernel::CONFIG_EXTS, 'glob');
        $configLoader->load($confDir . '/{packages}/' . $environment . '/*' . Kernel::CONFIG_EXTS, 'glob');
    }
}
$container->setParameter('storefrontRoot', $this->getPath());

        $container->addCompilerPass(new DisableTemplateCachePass());
        $container->addCompilerPass(new ReverseProxyCompilerPass());
        $container->addCompilerPass(new StorefrontMigrationReplacementCompilerPass());
    }

    private function buildConfig(ContainerBuilder $container, string $environment): void
    {
        $locator = new FileLocator('Resources/config');

        $resolver = new LoaderResolver([
            new XmlFileLoader($container$locator),
            new YamlFileLoader($container$locator),
            new IniFileLoader($container$locator),
            new PhpFileLoader($container$locator),
            new GlobFileLoader($container$locator),
            new DirectoryLoader($container$locator),
            new ClosureLoader($container),
        ]);

        $configLoader = new DelegatingLoader($resolver);

        
$container->addCompilerPass(new BusinessEventRegisterCompilerPass($classes), PassConfig::TYPE_BEFORE_OPTIMIZATION, 0);
    }

    /** * Looks for service definition files inside the `Resources/config` * directory and loads either xml or yml files. */
    private function registerContainerFile(ContainerBuilder $container): void
    {
        $fileLocator = new FileLocator($this->getPath());
        $loaderResolver = new LoaderResolver([
            new XmlFileLoader($container$fileLocator),
            new YamlFileLoader($container$fileLocator),
            new PhpFileLoader($container$fileLocator),
        ]);
        $delegatingLoader = new DelegatingLoader($loaderResolver);

        foreach ($this->getServicesFilePathArray($this->getPath() . '/Resources/config/services.*') as $path) {
            $delegatingLoader->load($path);
        }

        if ($container->getParameter('kernel.environment') === 'test') {
            


    private function buildConfig(ContainerBuilder $container, string $environment): void
    {
        $cacheDir = $container->getParameter('kernel.cache_dir');
        if (!\is_string($cacheDir)) {
            throw new \RuntimeException('Container parameter "kernel.cache_dir" needs to be a string');
        }

        $locator = new FileLocator('Resources/config');

        $resolver = new LoaderResolver([
            new XmlFileLoader($container$locator),
            new YamlFileLoader($container$locator),
            new IniFileLoader($container$locator),
            new PhpFileLoader($container$locator),
            new GlobFileLoader($container$locator),
            new DirectoryLoader($container$locator),
            new ClosureLoader($container),
        ]);

        $configLoader = new DelegatingLoader($resolver);

        
Home | Imprint | This part of the site doesn't use cookies.