55 if (!extension_loaded(
'wincache')) {
56 throw new \TYPO3\CMS\Core\Cache\Exception(
'The PHP extension "wincache" must be installed and loaded in order to use the wincache backend.', 1343331520);
58 parent::__construct(
$context, $options);
73 public function set($entryIdentifier, $data, array $tags = array(), $lifetime = NULL) {
74 if (!$this->cache instanceof \
TYPO3\CMS\Core\
Cache\Frontend\FrontendInterface) {
75 throw new \TYPO3\CMS\Core\Cache\Exception(
'No cache frontend has been set yet via setCache().', 1343331521);
77 if (!is_string($data)) {
78 throw new \TYPO3\CMS\Core\Cache\Exception\InvalidDataException(
'The specified data is of type "' . gettype($data) .
'" but a string is expected.', 1343331522);
80 $tags[] =
'%WCBE%' . $this->cache->getIdentifier();
82 $success = wincache_ucache_set($this->identifierPrefix . $entryIdentifier, $data, $expiration);
83 if ($success === TRUE) {
87 throw new \TYPO3\CMS\Core\Cache\Exception(
'Could not set value.', 1343331523);
97 public function get($entryIdentifier) {
99 $value = wincache_ucache_get($this->identifierPrefix . $entryIdentifier, $success);
100 return $success ? $value : $success;
109 public function has($entryIdentifier) {
110 return wincache_ucache_exists($this->identifierPrefix . $entryIdentifier);
121 public function remove($entryIdentifier) {
123 return wincache_ucache_delete($this->identifierPrefix . $entryIdentifier);
135 $identifiers = wincache_ucache_get($this->identifierPrefix .
'tag_' . $tag, $success);
136 if ($success === FALSE) {
139 return (array) $identifiers;
152 $tags = wincache_ucache_get($this->identifierPrefix .
'ident_' . $identifier, $success);
153 return $success ? (array) $tags : array();
163 if (!$this->cache instanceof \
TYPO3\CMS\Core\
Cache\Frontend\FrontendInterface) {
164 throw new \TYPO3\CMS\Core\Cache\Exception(
'Yet no cache frontend has been set via setCache().', 1343331524);
166 $this->
flushByTag(
'%WCBE%' . $this->cache->getIdentifier());
178 foreach ($identifiers as $identifier) {
179 $this->
remove($identifier);
193 $existingTagsUpdated = FALSE;
195 foreach ($tags as $tag) {
198 if (!in_array($entryIdentifier, $identifiers, TRUE)) {
199 $identifiers[] = $entryIdentifier;
200 wincache_ucache_set($this->identifierPrefix .
'tag_' . $tag, $identifiers);
203 if (!in_array($tag, $existingTags, TRUE)) {
204 $existingTags[] = $tag;
205 $existingTagsUpdated = TRUE;
210 if ($existingTagsUpdated) {
211 wincache_ucache_set($this->identifierPrefix .
'ident_' . $entryIdentifier, $existingTags);
225 foreach ($tags as $tag) {
232 if (($key = array_search($entryIdentifier, $identifiers)) !== FALSE) {
233 unset($identifiers[$key]);
234 if (count($identifiers)) {
235 wincache_ucache_set($this->identifierPrefix .
'tag_' . $tag, $identifiers);
237 wincache_ucache_delete($this->identifierPrefix .
'tag_' . $tag);
242 wincache_ucache_delete($this->identifierPrefix .
'ident_' . $entryIdentifier);
removeIdentifierFromAllTags($entryIdentifier)
addIdentifierToTags($entryIdentifier, array $tags)
__construct($context, array $options=array())
findTagsByIdentifier($identifier)
findIdentifiersByTag($tag)