diff --git a/src/Symfony/Bundle/FrameworkBundle/HttpCache/HttpCache.php b/src/Symfony/Bundle/FrameworkBundle/HttpCache/HttpCache.php index 1c5eb8c46b..114fe74a6d 100644 --- a/src/Symfony/Bundle/FrameworkBundle/HttpCache/HttpCache.php +++ b/src/Symfony/Bundle/FrameworkBundle/HttpCache/HttpCache.php @@ -49,9 +49,9 @@ abstract class HttpCache extends BaseHttpCache */ protected function forward(Request $request, $raw = false, Response $entry = null) { - $this->kernel->boot(); - $this->kernel->getContainer()->set('cache', $this); - $this->kernel->getContainer()->set('esi', $this->esi); + $this->getKernel()->boot(); + $this->getKernel()->getContainer()->set('cache', $this); + $this->getKernel()->getContainer()->set('esi', $this->esi); return parent::forward($request, $raw, $entry); } diff --git a/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php b/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php index e022f7f404..bf92ac39b6 100644 --- a/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php +++ b/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php @@ -128,6 +128,16 @@ class HttpCache implements HttpKernelInterface return $this->request; } + /** + * Gets the Kernel instance + * + * @return Symfony\Component\HttpKernel\HttpKernelInterface An HttpKernelInterface instance + */ + public function getKernel() + { + return $this->kernel; + } + /** * {@inheritdoc} */