获取缓存值

@param \Imi\Cache\Annotation\CachePut $cachePut
@param mixed $value
@return mixed
502997
protected function getValue(CachePut $cachePut, $value)
    {
        if(null === $cachePut->value)
        {
            return $value;
        }
        return ObjectArrayHelper::get($value, $cachePut->value);
    }
726450
public static Single<Long> remove(String cacheKey, Object value) {
        return remove(CacheService.CACHE_CONFIG_BEAN, cacheKey, value);
    }
1202083
public function store($cacheKey, $value, $minutes = 30)
    {
        $key = array_search($cacheKey, $this->cachedKeys);

        if ($key == false)
        {
            do
            {
                $key = uniqid();
            }
            while ($this->cache->isExisting($key));

            $this->cachedKeys[$key] = $cacheKey;
            $this->storeCachedKeys();
        }

        $this->cache->set($key, $value, $minutes * 60); //=> From seconds
    }
462950
public function setItem($cacheId, $content)
    {
        $cacheId = $this->normalizeKey($cacheId);

        try {
            return $this->cache->store($cacheId, serialize($content));
        } catch (ezcBaseException $ex) {
            return false;
        }
    }
742895
function cachePush(value) {
    var cache = this.cache,
        type = typeof value;

    if (type == 'boolean' || value == null) {
      cache[value] = true;
    } else {
      if (type != 'number' && type != 'string') {
        type = 'object';
      }
      var key = type == 'number' ? value : keyPrefix + value,
          typeCache = cache[type] || (cache[type] = {});

      if (type == 'object') {
        if ((typeCache[key] || (typeCache[key] = [])).push(value) == this.array.length) {
          cache[type] = false;
        }
      } else {
        typeCache[key] = true;
      }
    }
  }
416432
protected function setCache($key, $value) {
        $this->cachedData = $this->resolveCacheComponent()->get($this->cacheKeyName);
        if (empty($this->cachedData))
            $this->cachedData = [];
        $this->cachedData[$key] = $value;
        return $this->resolveCacheComponent()->set($this->cacheKeyName, $this->cachedData, $this->cacheDuration);
    }
616320
protected void putToCache(String cacheName, String key, Object value) {
        putToCache(cacheName, key, value, 0);
    }
107304
protected function cacheJsonDecode($value, $assoc = false)
    {
        if (!isset(static::$castCache[$value][$assoc])) {
            static::$castCache[$value][$assoc] = json_decode($value, $assoc);
        }

        return static::$castCache[$value][$assoc];
    }
913883
public static Single<Long> incrementByValue(String cacheKey, long value) {
        return incrementByValue(CacheService.CACHE_CONFIG_BEAN, cacheKey, value);
    }
565165
public function save($key = '', $value = '')
    {
        try {
            if ($this->cacheInstance !== NULL && is_object($this->cacheInstance)) {
                /**
                 * @var $cache object
                 */
                $cache = $this->cacheInstance->getItem($key);
                if (!$cache->isHit()) {
                    $cache->set($value)->expiresAfter($this->cacheTtl);//in seconds, also accepts Datetime
                    $this->cacheInstance->save($cache); // Save the cache item just like you do with doctrine and entities
                    $result = $cache->get();
                    $this->debug->debug(__FUNCTION__, 'Save Cache Key: ' . $key . ' with Value: ' . json_encode($value));
                } else {
                    $result = $cache->get();
                    $this->debug->debug(__FUNCTION__, 'Get Cache from Key: ' . $key . ', result: ' . json_encode($result));
                }
                $message = 'Final get Content from Key: ' . $key . ' => Output result: ' . json_encode($result);
                $this->debug->info(__FUNCTION__, $message);

                return $result;
            } else {
                $this->debug->error(__FUNCTION__, 'Unavailable cacheInstance');

                return NULL;
            }
        }
        catch (\Exception $e) {
            $message = 'Error File: ' . $e->getFile() . ' - Line: ' . $e->getLine() . ' - Code: ' . $e->getCode() . ' - Message: ' . $e->getMessage();
            $this->debug->error(__FUNCTION__, $message);

            return $message;
        }
    }
584809
private function cacheToolkit($keys, $value = null, $unset = false)
    {
        $element = &$this->cache;

        while ($keys && ($key = array_shift($keys))) {
            if (!$keys && is_null($value) && $unset) {
                unset($element[$key]);
                unset($element);
                $element = null;
            } else {
                $element =&$element[$key];
            }
        }

        if (!$unset && !is_null($value)) {
            $element = $value;
        }

        return $element;
    }
540092
public Integer cache(Object value) {
        synchronized (this) {
            Integer key = keys.get(value);
            // Already cached?
            if (key != null) return key;
            key = next;
            cache.put(key, value);
            keys.put(value, key);
            next++;
            return key;
        }
    }
465157
public function set($cacheId, $value)
    {
        $this->setToFirstLevelCache($cacheId, $value);
        $this->secondLevelCache->set($cacheId, $value);
    }
207310
public function cacheValue(string $key, $value)
    {
        if (!Config::get('activateDbCache')) {
            return false;
        }

        if ($this->getValue($key)) {
            throw new \Exception('Duplicate entry in tl_db_cache for key '.$key);
        }

        $now = time();

        $this->database->prepare('INSERT INTO tl_db_cache (tstamp, expiration, cacheKey, cacheValue) VALUES (?, ?, ?, ?)')->execute(
            $now,
            $now + $this->container->get('huh.utils.date')->getTimePeriodInSeconds(
                StringUtil::deserialize(Config::get('dbCacheMaxTime'), true)
            ),
            $key,
            $value
        );

        return true;
    }
948398
public static function get($value): EnumInterface
    {
        // Return the cached instance for given value if it already exists:
        if (null !== $instance = self::getCachedInstance($value)) {
            return $instance;
        }

        if (!static::accepts($value)) {
            throw new InvalidValueException($value, static::class);
        }

        return new static($value);
    }
1242198
public final function set(string $className, $value): CacheInterface
   {
       $this->service[$className] = $value;
       return $this;
   }
431364
public static function get($cacheName, $default = false, $option = array(), $alias = null)
	{
		$obj = self::getInstance($alias);
		if ($obj)
		{
			return $obj->get($cacheName, $default, $option);
		}
		else
		{
			return false;
		}
	}