ReverseProxyCompilerPass example

$loader->load('controller.xml');
        $loader->load('theme.xml');

        /** @var string $environment */
        $environment = $container->getParameter('kernel.environment');

        $this->buildConfig($container$environment);

        $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),
            
->setPublic(true);

        $container
            ->register(FastlyReverseProxyGateway::class, FastlyService::class)
            ->setPublic(true);

        $container
            ->register(DummyService::class)
            ->setPublic(true)
            ->addArgument(new Reference(AbstractReverseProxyGateway::class, ContainerInterface::NULL_ON_INVALID_REFERENCE));

        $container->addCompilerPass(new ReverseProxyCompilerPass());

        return $container;
    }
}

/** * @internal */
class OriginalService
{
}

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