I'm using the new Symfony Cache Component. I generate my cache first with a command (Command/AppCacheGenerateCommand.php):
$cache = new FilesystemAdapter();
foreach ($domains as $domain){
if ($domain->getHost()){
$output->writeln('Generate cache for domain: ' . $domain->getHost());
$domainCache = $cache->getItem('domain.' . $domain->getHost());
$domainCache->set($domain->getId());
$cache->save($domainCache);
}
}
Then trying to get these cached elements in a onKernelRequest EventListener (EventListener/RequestListener.php)
$cache = new FileSystemAdapter();
$domainCache = $cache->getItem('domain.' . $host);
if (!$domainCache->isHit()){
die;
}
It's always dies here, not going further. Anyone can give me an explanation? (I've tried if the host not matching, but it does...)