Get the full stream URI for the cache entry.

@param   string  $key  The storage entry identifier.

@return  string  The full stream URI for the cache entry.

@throws  \RuntimeException if the cache path is invalid.
515774
protected function fetchStreamUri($key)
	{
	    $key = $this->formatKey($key);
	    
	    // 20160312, parse key to path/nkey parts, 以支持带路径的 key 设置
	    $nPath = str_replace(['../', '..\\', './', '.\\'], '', dirname($key));
	    $nPath = trim($nPath, '/');
	    if ($nPath == '.') $nPath = '';
	    
	    $key  = basename($key);
        
	    $filePath = rtrim($this->options['path'], '/') . ($nPath ? '/' . $nPath : '');

		//$this->checkFilePath($filePath);
        
		return sprintf(
			'%s/%s' . '.' . $this->options['file_ext'], // 作为后缀
			$filePath,
			$key
		);
	}
963525
public function get($key)
    {
        $filePath = $this->getFilePathFromKey($key);

        if (!file_exists($filePath)) {
            return false;
        }

        if (!is_readable($filePath)) {
            return false;
        }

        $cacheFileData = file_get_contents($filePath);

        if ($this->config['gzipCompression']) {
            try {
                $cacheFileData = gzuncompress($cacheFileData);
            } catch (\Exception $e) {
                $cacheFileData = false;
            }
        }

        // Bail immediately if the file could not be read, or its data could not be uncompressed
        if (!$cacheFileData) {
            return false;
        }

        $cacheObj = json_decode($cacheFileData);

        // Unable to decode JSON
        if ($cacheObj === null) {
            return false;
        }

        // Check cache object format
        if (!isset($cacheObj->content) || !isset($cacheObj->expiryTimestamp)) {
            return false;
        }

        // Check cache content is serialized
        if (!$this->isSerialized($cacheObj->content)) {
            return false;
        }

        if (!function_exists('sys_getloadavg') && $this->config['unixLoadUpperThreshold'] !== -1) {
            throw new Exception('Your PHP installation does not support `sys_getloadavg` (Windows?). Please set `unixLoadUpperThreshold` to `-1` in your DOFileCache config.');
        }

        if ($this->config['unixLoadUpperThreshold'] == -1) {
            $unixLoad = [0 => -PHP_INT_MAX, 1 => -PHP_INT_MAX, 2 => -PHP_INT_MAX];
        } else {
            $unixLoad = sys_getloadavg();
        }

        if ($cacheObj->expiryTimestamp > time() || $unixLoad[0] >= $this->config['unixLoadUpperThreshold']) {
            // Cache item has not yet expired or system load is too high
            return unserialize($cacheObj->content);
        } else {
            // Cache item has expired
            return false;
        }
    }
1320336
public static function getFromCache($key)
  {
    static::initialize();
    $v = self::$cm->getFromCache($key);
    return $v ? $v['value'] : null;
  }
515097
public function get($key) {
		$filename = $this->getFileName($key);

		if ( ! is_file($filename)) {
			if ($this->log) {
				if ($this->log instanceof LoggerInterface) {
					$this->log->info("Retrieving key '{key}' from file cache: cache miss.", array('key'=>$key));
				} else {
					$this->log->trace("Retrieving key '$key' from file cache: cache miss.");
				}
			}
			return null;
		}
		$value = include $filename;

		if ($value['lifetime'] !== 0 && $value['lifetime'] < time()) {
			if ($this->log) {
				if ($this->log instanceof LoggerInterface) {
					$this->log->info("Retrieving key '{key}' from file cache: key outdated, cache miss.", array('key'=>$key));
				} else {
					$this->log->trace("Retrieving key '$key' from file cache: key outdated, cache miss.");
				}
			}
			return null;
		}

		if ($this->log) {
			if ($this->log instanceof LoggerInterface) {
				$this->log->info("Retrieving key '{key}' from file cache.", array('key'=>$key));
			} else {
				$this->log->trace("Retrieving key '$key' from file cache.");
			}
		}

		return $value['data'];
	}
828411
private function getCacheFilePath($key)
    {
        $hash = hash('sha256', $key);
        $subdir = substr($hash, 0, 2);
        $filename = substr($hash, 2);

        return $this->cacheDir
            . DIRECTORY_SEPARATOR
            . $subdir
            . DIRECTORY_SEPARATOR
            . $filename
        ;
    }
1345319
protected function get($key)
    {
        $this->checkForNonEmptyKey($key);
        if (!$this->requestDataHasBeenRetrieved) {
            $this->retrieveRequestData();
        }
        if (!isset($this->cachedRequestData[$key])) {
            return null;
        }

        return $this->cachedRequestData[$key];
    }
1195410
protected function getFilepath(string $key):string{
		$h = hash('sha256', $key);

		return $this->cachedir.$h[0].DIRECTORY_SEPARATOR.$h[0].$h[1].DIRECTORY_SEPARATOR.$h;
	}
1205512
public function getFlashed($key)
    {
        if ($this->has($key)) {
            // Save it before removing
            $value = $this->get($key);

            // And remove it
            $this->remove($key);
            return $value;
        } else {
            throw new RuntimeException(sprintf('Attempted to read non-existing session key "%s"', $key));
        }
    }
472044
protected function retrieve($key)
    {
        if (!$this->has($key)) {
            return null;
        }

        $cache = file_get_contents($this->path . $key);

        // compare the timestamp to the current time when we read the file.
        if (time() >= substr($cache, 0, 10)) {
            $this->forget($key);
            return null;
        }

        return unserialize(substr($cache, 10));
    }
285276
public function get($key)
    {
        if ($this->has($key)) {
            $flashMessages = $this->storage->get(self::FLASH_KEY);
            $message = $flashMessages[$key];

            $this->remove($key);

            if ($this->translator instanceof TranslatorInterface) {
                $message = $this->translator->translate($message);
            }

            return $message;
        } else {
            throw new RuntimeException(sprintf(
                'Attempted to read non-existing key %s', $key
            ));
        }
    }
564855
private function getFileName($key) {
		$key = str_replace(' ', '', $key);
		$cacheDir = rtrim($this->cachePath, '\\/') . '/';
		if ($this->directoryLevel > 0) {
			$hash = abs(crc32($key));
			$cacheDir .= $hash % 1024;
			for($i = 1; $i < $this->directoryLevel; ++$i) {
				if (($prefix = substr($hash, $i, 2)) !== false) {
					$cacheDir .= '/' . $prefix;
				}
			}
		}
		return $cacheDir . '/' . md5($key) . $this->cacheExt;
	}
816993
protected function getCacheFileName($key)
    {
        $name = strtolower(basename($key));
        $shopId = strtolower(basename($this->getShopIdCalculator()->getShopId()));

        return parent::CACHE_FILE_PREFIX . ".$shopId.$name.txt";
    }
627834
public function size($key)
    {
        $this->ensureDirectoryExists($this->directory, $this->create);

        if (-1 === $size = ftp_size($this->connection, $key)) {
            throw new \RuntimeException(sprintf('Unable to fetch the size of "%s".', $key));
        }

        return $size;
    }
1268405
public function getMinified(string $key): ?string
    {
        if (array_key_exists($key, $this->map)) {
            return $key;
        }

        $foundKey = array_search($key, $this->map);
        if ($foundKey === false) {
            throw new JoryException('Key '.$key.' is no valid Jory key.');
        }

        return $foundKey;
    }
876810
public function getKeyPath($key)
    {
        if (substr($key, 0, 1) !== '/') {
            $key = '/' . $key;
        }

        return rtrim('/' . $this->api_version . '/keys' . $this->root, '/') . $key;
    }
41867
public static function get($key)
    {
        $path = Cache::path($key);

        if (file_exists($path)) {
            return file_get_contents($path);
        }

        return null;
    }
706474
protected function getPath($key)
    {
        $parsed = $this->parseKey($key);

        array_shift($parsed);

        list ($dir, $file) = $parsed;
        return sprintf('%s/%s/%s', $this->path, $dir, $file);
    }