/** * Sets a reference to the cache frontend which uses this backend and * initializes the default cache directory * * @return void * @author Robert Lemke <*****@*****.**> */ public function setCache(\F3\FLOW3\Cache\Frontend\FrontendInterface $cache) { parent::setCache($cache); $cacheDirectory = $this->environment->getPathToTemporaryDirectory() . 'Cache/' . $this->cacheIdentifier . '/'; if (!is_writable($cacheDirectory)) { try { \F3\FLOW3\Utility\Files::createDirectoryRecursively($cacheDirectory); } catch (\F3\FLOW3\Utility\Exception $exception) { throw new \F3\FLOW3\Cache\Exception('The cache directory "' . $cacheDirectory . '" could not be created.', 1264426237); } } if (!is_dir($cacheDirectory)) { throw new \F3\FLOW3\Cache\Exception('The cache directory "' . $cacheDirectory . '" does not exist.', 1203965199); } if (!is_writable($cacheDirectory)) { throw new \F3\FLOW3\Cache\Exception('The cache directory "' . $cacheDirectory . '" is not writable.', 1203965200); } $this->cacheDirectory = $cacheDirectory; }
/** * Does garbage collection * * @return void * @author Karsten Dambekalns <*****@*****.**> * @api */ public function collectGarbage() { $this->backend->collectGarbage(); }
/** * Initializes the identifier prefix when setting the cache. * * @param \F3\FLOW3\Cache\Frontend\FrontendInterface $cache * @return void * @author Robert Lemke <*****@*****.**> * @author Karsten Dambekalns <*****@*****.**> */ public function setCache(\F3\FLOW3\Cache\Frontend\FrontendInterface $cache) { parent::setCache($cache); $processUser = extension_loaded('posix') ? posix_getpwuid(posix_geteuid()) : array('name' => 'default'); $this->scope = substr(md5(FLOW3_PATH_WEB . $this->environment->getSAPIName() . $processUser['name'] . $this->context), 0, 12); }
/** * Initializes the identifier prefix when setting the cache. * * @param \F3\FLOW3\Cache\Frontend\FrontendInterface $cache * @return void * @author Karsten Dambekalns <*****@*****.**> */ public function setCache(\F3\FLOW3\Cache\Frontend\FrontendInterface $cache) { parent::setCache($cache); $this->identifierPrefix = 'FLOW3_' . md5($cache->getIdentifier() . $this->environment->getScriptPathAndFilename() . $this->environment->getSAPIName()) . '_'; }