Find in cache

@param string $cacheKey

@return mixed
425619
public function find($cacheKey)
    {
        $key = array_search($cacheKey, $this->cachedKeys);

        if ($key != false and ! $this->cache->has($key))
        {
            unset($this->cachedKeys[$key]);
            $this->storeCachedKeys();

            return false;
        }

        return $key ? $this->cache->get($key) : false;
    }
1131848
protected function getCachePermissions($cacheKey)
    {
        // Check local cache
        if (isset($this->cachePermissions[$cacheKey])) {
            return $this->cachePermissions[$cacheKey];
        }

        // Check persistent cache
        if ($this->cacheService) {
            $result = $this->cacheService->get($cacheKey);

            // Warm local cache
            if ($result) {
                $this->cachePermissions[$cacheKey] = $result;
                return $result;
            }
        }

        return null;
    }
870837
public function getFromCache($key)
  {
    $value = $this->memcache->get($this->buildMKey($key));
    if ($value) {
      return unserialize($value);
    }
    return null;
  }
273606
public function get( $key )
    {
        $cache_file = new File($key.self::CACHE_FILE_EXT, $this->config->getCacheRoot());
    
        if (!$cache_file->exists()){
            return false;
        }
        if (!$cache_file->canRead()){
            throw( new CacheFileNotReadableException($cache_file) );
        }
        
        $lines = $cache_file->getContentsAsArray();
        
        static $keywords = [
            'expires', 'type', 'class', 'data'
        ];
        
        $cache_info =[];
        foreach($keywords as $keyword)
        {
            $line = array_shift($lines);
            $kwlen = strlen($keyword);
            
            if (!$line){
                throw( new CacheFileFormatException($cache_file) );
            }
            if (strlen($line) < $kwlen+1 || strpos($line,$keyword.':') !== 0){
                throw( new CacheFileFormatException($cache_file) );
            }
            $cache_info[$keyword] = substr($line,$kwlen+1);
        }
    
        // check expire date
        $expires = $cache_info['expires'] ? intval($cache_info['expires']) : null;
        if ($expires === null){
            throw( new CacheMetaDataException('expires',$expires) );
        }
        $now = time();
        if ($expires > 0 && $expires < $now){
            return null;
        }
        
        // decode data
        $data = $cache_info['data'] ?? null;
        if ($data === null){
            throw( new CacheMetaDataException('data',$data) );
        }
        $data = unserialize(base64_decode($data));
    
        // type check
        $type = $cache_info['type'] ?? null;
        if ($type === null){
            throw( new CacheMetaDataException('type',$type) );
        }
        if ($type !== gettype($data)){
            return null;
        }
    
        // class check
        if ($type === 'object'){
            $class = $cache_info['class'] ?? null;
            if ($class === null){
                throw( new CacheMetaDataException('class',$class) );
            }
            if (!($data instanceof $class)){
                return null;
            }
        }
    
        return $data;
    }
609504
public function getCachedItem($key)
    {
        $path = sha1($key);

        if ($this->filesystem()->has($path)) {
            $item = explode(PHP_EOL, $this->filesystem()->read($path), 2);

            return new CacheItemClass($key, $item[1] ?? null, $item[0] ?? null);
        }
    }
641731
protected function getCache($cacheKey)
    {
        $cacheKey = 'combiner.'.$cacheKey;

        if (!Cache::has($cacheKey)) {
            return false;
        }

        return @unserialize(@base64_decode(Cache::get($cacheKey)));
    }
207397
function get($key)
    {
        if (!array_key_exists($key, $this->cache)) {
            return $this->read_record($key);
        }

        return $this->cache[$key];
    }
63500
public function purgeByCacheKey($cacheKey)
    {
        // initialize log
        $log = new DebugLog();
        $log->addMessage('State', 'Purge by cache key');

        // remove the key from index
        $this->indexStorage->deleteEntryByKey($cacheKey);

        // purges from cache storage
        return $this->cacheStorage->purge($cacheKey);
    }
743996
public function containsKey($key)
    {
        if (!$this->enabled)
            return false;

        $has_key = false;

        $fetchMethod = $this->apcFuncPrefix.'_fetch';
        $fetchMethod($this->key($key), $has_key);

        // $this->Logger->debug("Cache contains {$key}? " . (($has_key) ? 'TRUE' : 'FALSE'));

        return $has_key;
    }
389971
public function getCache($key) {
        if (!$this->__cacheEnabled) {
            return null;
        }

        $key = $this->createCacheKey($key);

        if ($this->hasCache($key)) {
            return $this->_cache[$key];
        }

        return null;
    }
10592
public function get($key)
    {
        $file = $this->cacheDir . $this->getDir($key) . $this->getFile($key);
        if (file_exists($file) && is_readable($file)) {
            if (filemtime($file) > time()) {
                return file_get_contents($file);
            }
        }

        return false;
    }
521143
public function get(CacheKey $key) {

		if (isset ( $this->cache [$key->getModule()] [$key->getProperty()] )) {
			return $this->cache [$key->getModule()] [$key->getProperty()];
		} else {
			return false;
		}
	}
691244
function getCache( $key ) {

        return isset( $this->_cache[ $key ] ) ? $this->_cache[ $key ] : null;

    }
339012
public function cacheGet($key, $cache_mode = Cache::CACHE_AUTO)
    {
        if ($cache_mode === Cache::CACHE_FLUSH_ONLY ) {
            $this->getCache()->remove($key);
            return null;
        }
        
        return $this->getCache()->get($key);
    }
188877
public static function check($cacheloc, $cachekey)
    {
        $cacheloc = "cache_" . $cacheloc;
        if ( isset($_SESSION[$cacheloc]) ) {
            $cache_row = $_SESSION[$cacheloc];
            if ( time() >= $cache_row[2] ) { 
                unset($_SESSION[$cacheloc]);
                return false;
            }
            if ( $cache_row[0] == $cachekey ) {
                // error_log("Cache hit $cacheloc");
                return $cache_row[1];
            }
            unset($_SESSION[$cacheloc]);
        }
        return false;
    }
438136
def find_in_cache(cacheKey):
    """"""
    # If we have to use cache, we try to find the result in cache
    if cacheKey:

        data = cache.get('plugit-cache-' + cacheKey, None)

        # We found a result, we can return it
        if data:
            return (data['result'], data['menu'], data['context'])
    return (None, None, None)
503513
public function get($key)
    {
        if (isset($this->cache[$key])) {
            list($expires, $value) = $this->cache[$key];
            if (!$expires || ($expires >= microtime(true))) {
                return $value;
            }
            unset($this->cache[$key]);
        }
        return false;
    }