Fix kernel access in HttpCache due to kernel attribute privatization

This commit is contained in:
Matthieu Bontemps 2011-03-28 11:58:16 +02:00
parent 33456e63dc
commit aba6363452
2 changed files with 13 additions and 3 deletions

View File

@ -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);
}

View File

@ -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}
*/