2 namespace TYPO3\CMS\Core\Cache\Frontend;
42 $this->useIgBinary = extension_loaded(
'igbinary');
57 public function set($entryIdentifier, $variable, array $tags = array(), $lifetime = null)
60 throw new \InvalidArgumentException(
'"' . $entryIdentifier .
'" is not a valid cache entry identifier.', 1233058264);
62 foreach ($tags as $tag) {
64 throw new \InvalidArgumentException(
'"' . $tag .
'" is not a valid tag for a cache entry.', 1233058269);
67 if (is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/cache/frontend/class.t3lib_cache_frontend_variablefrontend.php'][
'set'])) {
68 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/cache/frontend/class.t3lib_cache_frontend_variablefrontend.php'][
'set'] as $_funcRef) {
70 'entryIdentifier' => &$entryIdentifier,
71 'variable' => &$variable,
73 'lifetime' => &$lifetime
78 if ($this->useIgBinary ===
true) {
79 $this->backend->set($entryIdentifier, igbinary_serialize($variable), $tags, $lifetime);
81 $this->backend->set($entryIdentifier, serialize($variable), $tags, $lifetime);
93 public function get($entryIdentifier)
96 throw new \InvalidArgumentException(
'"' . $entryIdentifier .
'" is not a valid cache entry identifier.', 1233058294);
98 $rawResult = $this->backend->get($entryIdentifier);
99 if ($rawResult ===
false) {
102 return $this->useIgBinary ===
true ? igbinary_unserialize($rawResult) : unserialize($rawResult);
117 throw new \InvalidArgumentException(
'"' . $tag .
'" is not a valid tag for a cache entry.', 1233058312);
120 $identifiers = $this->backend->findIdentifiersByTag($tag);
122 $rawResult = $this->backend->get($identifier);
123 if ($rawResult !==
false) {
124 $entries[] = $this->useIgBinary ===
true ? igbinary_unserialize($rawResult) : unserialize($rawResult);