Skip to content
This repository has been archived by the owner on Jul 4, 2018. It is now read-only.

Commit

Permalink
fixed Symfony Http Kernel Cache deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Jan 20, 2015
1 parent 3af0b91 commit 911f249
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Silex/Provider/HttpCacheServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
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.
Expand Down Expand Up @@ -46,6 +47,10 @@ public function register(Application $app)
});

$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']);
});

Expand Down

0 comments on commit 911f249

Please sign in to comment.