/** * Internal method to check if the given cache supports tags * * @param IfwPsn_Vendor_Zend_Cache $cache */ private static function _getTagSupportForCache() { $backend = self::$_cache->getBackend(); if ($backend instanceof IfwPsn_Vendor_Zend_Cache_Backend_ExtendedInterface) { $cacheOptions = $backend->getCapabilities(); self::$_cacheTags = $cacheOptions['tags']; } else { self::$_cacheTags = false; } return self::$_cacheTags; }
/** * Test if a cache is available for the given id * * @param string $id Cache id * @return int|false Last modified time of cache entry if it is available, false otherwise */ public function test($id) { $lastModified = parent::test($id); if ($lastModified) { if ($this->_specificOptions['master_files_mode'] == self::MODE_AND) { // MODE_AND foreach ($this->_masterFile_mtimes as $masterFileMTime) { if ($masterFileMTime) { if ($lastModified > $masterFileMTime) { return $lastModified; } } } } else { // MODE_OR $res = true; foreach ($this->_masterFile_mtimes as $masterFileMTime) { if ($masterFileMTime) { if ($lastModified <= $masterFileMTime) { return false; } } } return $lastModified; } } return false; }
/** * Constructor * * @param array $options Associative array of options * @return void */ public function __construct(array $options = array()) { parent::__construct($options); $this->_idStack = array(); }
/** * Public frontend to set an option * * Just a wrapper to get a specific behaviour for cached_entity * * @param string $name Name of the option * @param mixed $value Value of the option * @throws IfwPsn_Vendor_Zend_Cache_Exception * @return void */ public function setOption($name, $value) { if ($name == 'cached_entity') { $this->setCachedEntity($value); } else { parent::setOption($name, $value); } }