/** * Constructs the cache * * @param string A identifier which describes this cache * @param t3lib_cache_backend_Backend Backend to be used for this cache * @author Robert Lemke <*****@*****.**> * @throws InvalidArgumentException if the identifier doesn't match PATTERN_ENTRYIDENTIFIER * @internal */ public function __construct($identifier, t3lib_cache_backend_Backend $backend) { if (!preg_match(self::PATTERN_ENTRYIDENTIFIER, $identifier)) { throw new InvalidArgumentException('"' . $identifier . '" is not a valid cache identifier.', 1203584729); } $this->identifier = $identifier; $this->backend = $backend; $this->backend->setCache($this); }
/** * Initializes the identifier prefix when setting the cache. * * @param t3lib_cache_frontend_Frontend $cache The frontend for this backend * @return void * @author Robert Lemke <*****@*****.**> */ public function setCache(t3lib_cache_frontend_Frontend $cache) { parent::setCache($cache); $processUser = extension_loaded('posix') ? posix_getpwuid(posix_geteuid()) : array('name' => 'default'); $pathHash = t3lib_div::shortMD5(PATH_site . $processUser['name'], 12); $this->identifierPrefix = 'TYPO3_' . $pathHash; }
/** * Sets a reference to the cache frontend which uses this backend and * initializes the default cache directory * * @void * @author Robert Lemke <*****@*****.**> */ public function setCache(t3lib_cache_frontend_Frontend $cache) { parent::setCache($cache); if (empty($this->cacheDirectory)) { $cacheDirectory = 'typo3temp/cache/'; try { $this->setCacheDirectory($cacheDirectory); } catch (t3lib_cache_Exception $exception) { } } }
/** * Initializes the identifier prefix when setting the cache. * * @param t3lib_cache_frontend_Frontend $cache The frontend for this backend * @return void * @author Robert Lemke <*****@*****.**> * @author Dmitry Dulepov */ public function setCache(t3lib_cache_frontend_Frontend $cache) { parent::setCache($cache); $this->identifierPrefix = 'TYPO3_' . md5(PATH_site) . '_'; }