/** * Sets a reference to the cache frontend which uses this backend and * initializes the default cache directory. * * This method also detects if this backend is frozen and sets the internal * flag accordingly. * * @param FrontendInterface $cache The cache frontend * @return void * @throws Exception */ public function setCache(FrontendInterface $cache) { parent::setCache($cache); if (is_file($this->cacheDirectory . 'FrozenCache.data')) { $this->frozen = true; $cachePathAndFileName = $this->cacheDirectory . 'FrozenCache.data'; $lock = new Lock($cachePathAndFileName, false); $data = file_get_contents($cachePathAndFileName); $lock->release(); if ($this->useIgBinary === true) { $this->cacheEntryIdentifiers = igbinary_unserialize($data); } else { $this->cacheEntryIdentifiers = unserialize($data); } } }
/** * Sets a reference to the cache frontend which uses this backend and * initializes the default cache directory. * * This method also detects if this backend is frozen and sets the internal * flag accordingly. * * @param \TYPO3\Flow\Cache\Frontend\FrontendInterface $cache The cache frontend * @return void * @throws \TYPO3\Flow\Cache\Exception */ public function setCache(\TYPO3\Flow\Cache\Frontend\FrontendInterface $cache) { parent::setCache($cache); if (file_exists($this->cacheDirectory . 'FrozenCache.data')) { $this->frozen = TRUE; $cachePathAndFileName = $this->cacheDirectory . 'FrozenCache.data'; $lock = new Lock($cachePathAndFileName, FALSE); $data = file_get_contents($cachePathAndFileName); $lock->release(); if ($this->useIgBinary === TRUE) { $this->cacheEntryIdentifiers = igbinary_unserialize($data); } else { $this->cacheEntryIdentifiers = unserialize($data); } } }
/** * Sets a reference to the cache frontend which uses this backend and * initializes the default cache directory. * * This method also detects if this backend is frozen and sets the internal * flag accordingly. * * @param \TYPO3\Flow\Cache\Frontend\FrontendInterface $cache The cache frontend * @return void * @throws \TYPO3\Flow\Cache\Exception */ public function setCache(\TYPO3\Flow\Cache\Frontend\FrontendInterface $cache) { parent::setCache($cache); if (file_exists($this->cacheDirectory . 'FrozenCache.data')) { $this->frozen = TRUE; if ($this->useIgBinary === TRUE) { $this->cacheEntryIdentifiers = igbinary_unserialize(file_get_contents($this->cacheDirectory . 'FrozenCache.data')); } else { $this->cacheEntryIdentifiers = unserialize(file_get_contents($this->cacheDirectory . 'FrozenCache.data')); } } }