/** * @param CacheKey $key * @depreciated */ public function clearModule(CacheKey $key) { $module = $key->getModule(); $iterator = new \APCIterator('user'); while ($iterator->current()) { $tKey = $iterator->key(); if (mb_strpos($tKey, $module . '||') !== false) { apc_delete($tKey); } $iterator->next(); } }
public function set(CacheKey $key, $value, $sessionLength = null) { $module = $key->getModule(); $property = $key->getProperty(); if ($sessionLength == null) { $sessionLength = $this->timeThreshold; } if (!isset($this->elements[$module][$property])) { $this->elements[$module][$property] = new FileElement($value, time() + $sessionLength); } else { /** @noinspection PhpUndefinedMethodInspection */ $this->elements[$module][$property]->set($value, time() + $sessionLength); } if (!isset($_SESSION[$this->cacheMaintenanceTimeName][$module])) { $_SESSION[$this->cacheMaintenanceTimeName][$module] = time() + $sessionLength; } $this->changed = true; }
/** * Unset cache value * @param CacheKey $key */ public function clear(CacheKey $key) { unset($this->cache[$key->getModule()][$key->getProperty()]); }
/** * @param CacheKey $key * @return string */ protected function getKey(CacheKey $key) { return static::$sCachePrefix . '__' . $key->getModule() . '||' . $key->getProperty(); }
public function clear(CacheKey $key) { $module = $key->getModule(); $id = $key->getProperty(); if (!empty($id)) { unset($_SESSION[$this->cacheName][$module][$id]); } else { unset($_SESSION[$this->cacheName][$module]); } }