src/DependencyInjection/SonataPageExtension.php
/**
     * Configure the cache options.
     *
     * @param ContainerBuilder $container Container builder
     * @param array            $config    Array of configuration
     */
Configure the cache options.
@param ContainerBuilder $container Container builder
@param array            $config    Array of configuration
Configure the cache options . @param ContainerBuilder $container Container builder @param array $config Array of configuration
public function configureCache(ContainerBuilder $container, array $config)
    {
        if (isset($config['caches']['esi'])) {
            $container
                ->getDefinition('sonata.page.cache.esi')
                ->replaceArgument(0, $config['caches']['esi']['token'])
                ->replaceArgument(1, $config['caches']['esi']['servers'])
                ->replaceArgument(3, 3 === $config['caches']['esi']['version'] ? 'ban' : 'purge');
        } else {
            $container->removeDefinition('sonata.page.cache.esi');
        }
        if (isset($config['caches']['ssi'])) {
            $container
                ->getDefinition('sonata.page.cache.ssi')
                ->replaceArgument(0, $config['caches']['ssi']['token']);
        } else {
            $container->removeDefinition('sonata.page.cache.ssi');
        }
    }
public function configureCache ( ContainerBuilder $ container , array $ config ) { if ( isset ( $ config [ 'caches' ] [ 'esi' ] ) ) { $ container -> getDefinition ( 'sonata.page.cache.esi' ) -> replaceArgument ( 0 , $ config [ 'caches' ] [ 'esi' ] [ 'token' ] ) -> replaceArgument ( 1 , $ config [ 'caches' ] [ 'esi' ] [ 'servers' ] ) -> replaceArgument ( 3 , 3 === $ config [ 'caches' ] [ 'esi' ] [ 'version' ] ? 'ban' : 'purge' ) ; } else { $ container -> removeDefinition ( 'sonata.page.cache.esi' ) ; } if ( isset ( $ config [ 'caches' ] [ 'ssi' ] ) ) { $ container -> getDefinition ( 'sonata.page.cache.ssi' ) -> replaceArgument ( 0 , $ config [ 'caches' ] [ 'ssi' ] [ 'token' ] ) ; } else { $ container -> removeDefinition ( 'sonata.page.cache.ssi' ) ; } }
Configure the cache options.
Configure the cache options .