static function generateCacheKey($internalUri, $hostName = '', $vary = '', $contextualPrefix = '') { //hack to avoid infinite loop with sfViewCacheManager::generateCacheKey() sfConfig::set('sf_cache_namespace_callable', null); $cache = sfContext::getInstance()->getViewCacheManager(); if (!$cache) { throw new Exception('no cache!'); } $key = $cache->generateCacheKey($internalUri, $hostName, $vary, $contextualPrefix); //end hack ProjectConfiguration::configureCache(); //add scope to avoid namespace collisions between page, action, and fragment caches if (!strstr($internalUri, '_sf_cache_key=')) { $keyParts = explode('/', substr($key, 1)); array_splice($keyParts, 4, 0, array('_sf_cache_key', $cache->withLayout($internalUri) ? '_page' : '_action')); $key = '/' . implode('/', $keyParts); } return $key; }
public function configure() { ProjectConfiguration::configureDirs(); ProjectConfiguration::configureCache(); }