/** * Sets a reference to the cache frontend which uses this backend and * initializes the default cache directory. * * @param \Neos\Cache\Frontend\FrontendInterface $cache The cache frontend * @return void * @throws Exception */ public function setCache(FrontendInterface $cache) { parent::setCache($cache); $this->cacheEntryFileExtension = $cache instanceof PhpFrontend ? '.php' : ''; $this->configureCacheDirectory(); }
/** * Initializes the identifier prefix when setting the cache. * * @param FrontendInterface $cache * @return void */ public function setCache(FrontendInterface $cache) { parent::setCache($cache); $pathHash = substr(md5($this->environmentConfiguration->getApplicationIdentifier() . $this->environmentConfiguration->getApplicationContext() . $cache->getIdentifier()), 0, 12); $this->identifierPrefix = 'Flow_' . $pathHash . '_'; }
/** * Initializes this frontend * * The backend is connected with this frontend in initializeObject(), not in __construct(), because the Cache Factory * needs an opportunity to register the cache before the backend's setCache() method is called. See * CacheFactory::create() for details. A backend (for example the SimpleFileBackend) may rely on the cache already * being registered at the CacheManager when its setCache() method is called. * * @return void */ public function initializeObject() { // FIXME: This can be removed in next major, since the Backend gets the Frontend set in the cache factory now. $this->backend->setCache($this); }