Commit 911f2499 authored by Fabien Potencier's avatar Fabien Potencier

fixed Symfony Http Kernel Cache deprecations

parent 3af0b910
......@@ -17,6 +17,7 @@ use Silex\HttpCache;
use Symfony\Component\HttpKernel\HttpCache\Esi;
use Symfony\Component\HttpKernel\HttpCache\Store;
use Symfony\Component\HttpKernel\EventListener\EsiListener;
use Symfony\Component\HttpKernel\EventListener\SurrogateListener;
/**
* Symfony HttpKernel component Provider for HTTP cache.
......@@ -46,6 +47,10 @@ class HttpCacheServiceProvider implements ServiceProviderInterface
});
$app['http_cache.esi_listener'] = $app->share(function ($app) {
if (class_exists('Symfony\Component\HttpKernel\EventListener\SurrogateListener')) {
return new SurrogateListener($app['http_cache.esi']);
}
return new EsiListener($app['http_cache.esi']);
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment