public function onRequest(GetResponseEvent $event)
{
if (Zone::isBackend($event->getRequest())) {
$this->setVersionChangeNotice();
}
// Twig globals
$this->setGlobals(false);
// Only cache if the config passes checks
if ($this->app['config']->checkConfig() === false) {
return null;
}
// Final thing we do, if we're still standing, is to save our
// configuration to cache
if (!$this->app['config']->get('general/caching/config')) {
return null;
}
try {
$this->app['config']->cacheConfig();
} catch (IOException $e) {
$response = $this->app['controller.exception']->genericException($e);
$event->setResponse($response);
}
return null;
}