Read session data from memcache

@param $key
@return null|string
429498
public function read($key)
    {
        if ($value = $this->memcache->get($key)) {
            $arr = unserialize($value);
            $this->changed = $arr['changed'];
            $this->ip      = $arr['ip'];
            $this->vars    = $arr['vars'];
            $this->key     = $key;
        }

        if ($this->debug) {
            $this->debug('get', $key, $value);
        }

        return $this->vars ?: '';
    }
855811
public static function get($key) {
		$memcached = self::connect();
		$var = $memcached->get($key);
		if ($var === false) {
			throw new \Exception('Object not in cache');
		} else {
			return $var;
		}
	}
1015197
public static function pull($key)
    {
        if (isset($_SESSION[self::$prefix . $key])) {
            $value = $_SESSION[self::$prefix . $key];
            unset($_SESSION[self::$prefix . $key]);

            return $value;
        }

        return null;
    }
1364616
public function getConfigHeader($key)
    {
        $path = $this->getDir() . 'config/header/' . $key . '.conf.php';
        if (is_readable($path) && is_file($path)) {
            return file_get_contents($path);
        }
        return null;
    }
474090
public function getFromCache($key)
    {
        $fileName = $this->getCacheFilePath($key);
        $value = null;
        if (is_readable($fileName)) {
            $value = file_get_contents($fileName);
            if ($value == serialize(false)) {
                return false;
            }

            $value = unserialize($value);
            if ($value === false) {
                $value = null;
            }
        }

        return $value;
    }
941144
protected function read(array $keys)
    {
        $_keys = $lookup = array();
        foreach ($keys as $k) {
            $_k = sha1($k);
            $_keys[] = $_k;
            $lookup[$_k] = $k;
        }
        $_res = array();
        $res = $this->memcache->get($_keys);
        foreach ($res as $k => $v) {
            $_res[$lookup[$k]] = $v;
        }

        return $_res;
    }
256427
public function getCacheTime($key)
    {
        $file=$this->getCacheDir().$key;
        if(file_exists($file))
            return filemtime($file);
            return null;
    }
337863
protected function retrieve($key)
    {
        if (($cache = $this->memcache->get($this->key . $key)) !== false) {
            return $cache;
        }

        return null;
    }
126200
protected function getData($key)
    {
        $filename = $this->file($key);
        if (!file_exists($filename))
            return false;
        else {
            $data = $this->readFile($filename);

            if ($this->isExpired(null, $data))
                return false;
            else {
                 // if going to expire in 10 seconds, extend the cache and let this request refresh it
                $expire   = $data['expires'];
                $value    = $data['value'];
                $duration = $data['duration'];
                $now      = $this->DateFactory->newStorageDate();
                if (!empty($value) && $duration > 0 && $now->toUnix() > ($expire - 10) ) {
                    $this->put($key, $value, $duration);
                    return false;
                }

                return $data;
            }
        }

    }
1117502
public function readFrom(string $key)
    {
        $result = false;

        if ($this->skipCache()) {
            $this->warnings[] = 'Skipping read from cache';

            return $result;
        }

        $cachedData = CakeCache::read($key, $this->getConfig());
        if (!$this->isValidCache($cachedData)) {
            CakeCache::delete($key, $this->getConfig());

            return $result;
        }
        $result = $cachedData['data'];

        return $result;
    }
940468
public function get($key)
    {
        $entry = $this->redis->hGet($this->cacheKey, $key);

        if ($entry) {
            $entry = unserialize($entry);

            if ($entry['expire']) {
                // Check expires
                $now = new \DateTime('now', new \DateTimeZone('UTC'));
                if ((int) $now->format('U') > $entry['expire']) {
                    $this->remove($key);

                    return null;
                }
            }

            return $entry['value'];
        }

        return null;
    }
506753
public function read(string $key)
    {
        if (isset($this->cache[$key])) {
            $expire = (int)$this->cache[$key]['ttl'];

            if ($expire === 0 || time() < $expire) {
                return $this->cache[$key]['data'];
            }

            $this->delete($key);
            return false;
        }

        return false;
    }
1246071
private function getSession($key)
    {
        return isset($this->collection[$this->id][$key]) ? $this->collection[$this->id][$key] : null;
    }
854925
public function read($key)
    {
        try {
            $cache = $this->db->from($this->table)
                ->where($this->columns['key'])->eq($this->prefix . $key)
                ->select()
                ->fetchAssoc()
                ->first();
        } catch (PDOException $e) {
            return false;
        }

        if ($cache !== false) {
            $expire = (int) $cache[$this->columns['ttl']];

            if ($expire === 0 || time() < $expire) {
                return unserialize($cache[$this->columns['data']]);
            }

            $this->delete($key);
        }

        return false;
    }
233038
public function get($key)
    {
        $data = [];
        $data = $this->memcached()->get($key);

        return ($this->memcached()->getResultCode() == 0) ? $data : null;
    }
1126788
protected function get_cache($key)
    {
        // no session data in cache (read() returns false)
        if (!$this->key) {
            $cache = null;
        }
        // use internal data for fast requests (up to 0.5 sec.)
        else if ($key == $this->key && (!$this->vars || microtime(true) - $this->start < 0.5)) {
            $cache = $this->vars;
        }
        else { // else read data again
            $cache = $this->read($key);
        }

        return $cache;
    }
1356874
public function read($key)
    {
        $key = $this->_key($key);

        if (!$this->_init || $this->_setKey($key) === false) {
            return false;
        }

        if ($this->_config['lock']) {
            $this->_File->flock(LOCK_SH);
        }

        $this->_File->rewind();
        $time = time();
        $cachetime = (int)$this->_File->current();

        if ($cachetime < $time) {
            if ($this->_config['lock']) {
                $this->_File->flock(LOCK_UN);
            }

            return false;
        }

        $data = '';
        $this->_File->next();
        while ($this->_File->valid()) {
            $data .= $this->_File->current();
            $this->_File->next();
        }

        if ($this->_config['lock']) {
            $this->_File->flock(LOCK_UN);
        }

        $data = trim($data);

        if ($data !== '' && !empty($this->_config['serialize'])) {
            if ($this->_config['isWindows']) {
                $data = str_replace('\\\\\\\\', '\\', $data);
            }
            $data = unserialize((string)$data);
        }

        return $data;
    }