Reads cache entry.

@param string  $key     Cache key name
@param boolean $nostore Enable to skip in-memory store

@return mixed Cached value
436648
private function read_record($key, $nostore=false)
    {
        if (!$this->db) {
            return null;
        }

        if ($this->type != 'db') {
            $this->load_index();

            // Consistency check (#1490390)
            if (!in_array($key, $this->index)) {
                // we always check if the key exist in the index
                // to have data in consistent state. Keeping the index consistent
                // is needed for keys delete operation when we delete all keys or by prefix.
            }
            else {
                $ckey = $this->ckey($key);

                if ($this->type == 'memcache') {
                    $data = $this->db->get($ckey);
                }
                else if ($this->type == 'apc') {
                    $data = apc_fetch($ckey);
                }

                if ($this->debug) {
                    $this->debug('get', $ckey, $data);
                }
            }

            if ($data !== false) {
                $md5sum = md5($data);
                $data   = $this->unserialize($data);

                if ($nostore) {
                    return $data;
                }

                $this->cache_sums[$key] = $md5sum;
                $this->cache[$key]      = $data;
            }
            else {
                $this->cache[$key] = null;
            }
        }
        else {
            $sql_result = $this->db->query(
                "SELECT `data`, `cache_key` FROM {$this->table}"
                . " WHERE `user_id` = ? AND `cache_key` = ?",
                $this->userid, $this->prefix.'.'.$key);

            if ($sql_arr = $this->db->fetch_assoc($sql_result)) {
                if (strlen($sql_arr['data']) > 0) {
                    $md5sum = md5($sql_arr['data']);
                    $data   = $this->unserialize($sql_arr['data']);
                }

                $this->db->reset();

                if ($nostore) {
                    return $data;
                }

                $this->cache[$key]      = $data;
                $this->cache_sums[$key] = $md5sum;
            }
            else {
                $this->cache[$key] = null;
            }
        }

        return $this->cache[$key];
    }
576268
public function get($key) {
		
		if ($this->useFallback) {
			$filename = $this->getFileName($key);
			
			if (is_readable($filename)) {
				$fp = fopen($filename, "r");
				$timeout = fgets($fp);
					
				if ($timeout > time() || $timeout==0) {
					$contents = "";
					while (!feof($fp)) {
						$contents .= fread($fp, 65536);
					}
					fclose($fp);
					$value = unserialize($contents);
					//$this->log->trace("Retrieving key '$key' from file cache: value returned:".var_export($value, true));
					if ($this->log) {
						$this->log->trace("Retrieving key '$key' from file cache.");
					}
					return $value;
				} else {
					fclose($fp);
					unlink($filename);
					if ($this->log) {
						$this->log->trace("Retrieving key '$key' from file cache: key outdated, cache miss.");
					}
					return null;
				}
			} else {
				if ($this->log) {
					$this->log->trace("Retrieving key '$key' from file cache: cache miss.");
				}
				return null;
			}
		}
		
		// If not fallback
	
		$success = false;
		$value = apc_fetch($key, $success);
	
		if ($success) {
			if ($this->log) {
				$this->log->trace("Retrieving key '$key' from file cache.");
			}
			return $value;
		} else {
			if ($this->log) {
				$this->log->trace("Retrieving key '$key' from file cache: cache miss");
			}
			return null;
		}
	}
49606
public function read($key) {
        $cache = Zend_Registry::get('CacheFrontend');
        // fetch results from cache
        if ($cache->test($key)) {
            $results = $cache->load($key);
            if (!is_array($results)) {
                return -1;
            }
            $version = (int)$cache->load($this->_versionKey);
            // compare version numbers
            if (array_key_exists('version', $results) && (int)$results['version'] === $version) {
                return $results['data'];
            }
        }
        return -1;
    }
247817
public function get($key)
    {
        if (isset($this->storage[$key])) {
            return $this->storage[$key];
        }
        return false;
    }
75218
public function get($key) {
        $key = $this->conf['keyPrefix'] . $key;
        $s = $this->cache->get($key);
        if ($s === false) {
            X::logger()->trace("MCache miss $key");
            return false;
        }

        X::logger()->trace("MCache hit $key");
        /** @noinspection UnserializeExploitsInspection */
        return is_numeric($s) ? $s : unserialize($s);
    }
349924
public function read($key)
    {
        if (!isset($this->cacheDirectory)) {
            return;
        }

        $this->loadCacheMetaData();

        return unserialize(file_get_contents($this->cacheDirectory . '/' . $key));
    }
986823
public function read($key)
    {
        $key = $this->_key($key);

        return $this->_Memcached->get($key);
    }
223815
public function getStorageValue($key = false) {
        $key = (!$key ? $this->name."InputResult" : $key);
        $storedData = $this->storedFormData;
        if (empty($storedData)) {
            $storageContainer = $this->getStorageContainer();
            if ($storageContainer->offsetExists($key))
                $storedData = $storageContainer->get($key);
            else return false;

        }
        return $storedData;
    }
129934
public function read($key)
    {
        $this->init();
        list($containerName, $key) = $this->tokenizeKey($key);

        try {
            $blob = $this->blobProxy->getBlob($containerName, $key);

            return stream_get_contents($blob->getContentStream());
        } catch (ServiceException $e) {
            $this->failIfContainerNotFound($e, sprintf('read key "%s"', $key), $containerName);

            return false;
        }
    }
358979
public function check($key = null)
    {
        if (empty($key)) {
            return false;
        }

        return $this->read($key) !== null;
    }
1362107
public function read(string $key)
    {
        $file = $this->cacheFile($key);

        if (is_file($file)) {
            // Cache exists
            $data = include $file;
            $expire = (int)$data['ttl'];
            if ($expire === 0 || time() < $expire) {
                return unserialize($data['data']);
            }
            unlink($file);
        }

        return false;
    }
832127
protected function load($key) {
        try {
            return $this->memcached->get($key);
        } catch (\Exception $e) {
            throw new StorageException("Failed to load memcached key: $key", 1, $e);
        }
    }
709476
public function &offsetGet($key)
    {
        $ret = null;

        if (!$this->offsetExists($key)) {
            return $ret;
        }

        $ret =& $this->storage[$key];

        return $ret;
    }
249367
public function read($key) 
    {
        if (!$this->enabled) {
            return null;
        }
        
        $this->stats['execTimes'] ++;
        $this->stats['readTimes'] ++;
        
        $cachePath = $this->getCachePath($key);
        
        $this->waitUnlock($key);
        $data = $this->obj->get($cachePath);
        
        if (false !== $data) {
            $this->stats['readSize'] += strlen($data)/1024;
            $data = unserialize($data);
            return $data;
        }
    
        return null;
    }
791976
public function get($key) {
		// First, check to see if the result has been cached.
		if (!isset($this->_cache[$key])) {
			return FALSE;
		}

		// Second, check its freshness.
		if ($this->_cache[$key]['time'] < time() - self::$_lifespan) {
			return FALSE;
		}

		return $this->_cache[$key]['data'];
	}
697767
public static function read(string $key)
    {
        /* Check if initialized */
        if (!self::$initialized) {
            self::initialize();
        }

        /* Return key */
        return self::$configs[$key];
    }
1343589
public function readLogin($key)
    {
        $key = $this->getKey($key);
        
        $ticket = Cookie::get($key);
        return $ticket ? Cache::get($ticket) : null;
    }