Gets the cache file from the filesystem

@param $id
@param null $subId
@return CacheEntryInterface
542800
public static function load($id, $subId = null) : CacheEntryInterface
    {
        $storageId = $id;

        if ($subId) {
            $storageId .= '[' . $subId . ']';
        }

        if (!isset(self::$files[$storageId])) {
            $filename = static::CACHE_DIR . ($subId ? $subId . '/' : null) . urlencode($id) . '.' . static::CACHE_EXTENSION;
            self::$files[$storageId] = new File($filename);
        }

        return self::$files[$storageId];
    }
1099115
public function lookup($id) {
        if ($pos = strpos($id, ',')) {
            $id = substr($id, 0, $pos);
        }

        $cacheKey = 'volume_' . $id;

        if ($this->cache && $this->cache->has($cacheKey)) {
            $val = $this->cache->get($cacheKey);

            if (!$val instanceof Volume) {
                $val = new Volume($val);
            }

            return $val;
        }

        $res = $this->client->get($this->buildMasterUrl(self::DIR_LOOKUP), [
            'query' => [ 'volumeId' => $id ]
        ]);

        if ($res->getStatusCode() != 200) {
            throw new SeaweedFSException('Unexpected response when looking up volume: ' . $res->getStatusCode());
        }

        $body = json_decode((string) $res->getBody());

        $volume = new Volume($body);

        if ($this->cache) {
            $this->cache->put($cacheKey, $volume);
        }

        return $volume;
    }
525079
public function getPluginPath($id)
    {
        $classId = $this->getIdentifier($id);
        if (!isset($this->pathMap[$classId])) {
            return null;
        }

        return File::normalizePath($this->pathMap[$classId]);
    }
331459
public function fetch( $id ) {

		if ( $this->contains( $id ) ) {
			$this->cacheHits++;
			return $this->moveToMostRecentlyUsedPosition( $id );
		}

		$this->cacheMisses++;
		return false;
	}
974349
public function getCache($userId)
    {
        if (is_file($this->getCacheFile($userId))) {
            $handle = fopen($this->getCacheFile($userId), 'r');
            $data   = fread($handle, filesize($this->getCacheFile($userId)));
            $cache  = unserialize($data);

            fclose($handle);

            if ($cache instanceof Cache) {
                return $cache;
            }
        }

        return new Cache();
    }
537805
public function fetch( $id ) {

		if ( $this->contains( $id ) ) {
			$this->cacheHits++;
			return $this->inMemoryCache[ $id ];
		}

		$this->cacheMisses++;
		return false;
	}
894588
public function getMainPageById($id, $mode = AbstractQuery::HYDRATE_ARRAY)
    {
        $qb = $this->getEntityManager()->createQueryBuilder();
        $qb->select('e.id, t.layout', 'p.id as parentId', 't.id as templateId')
            ->from($this->getEntity(), 'e')
            ->leftJoin('e.template', 't')
            ->leftJoin('e.parent', 'p')
            ->where('e.id = :id')
            ->setParameters(
                [
                    ':id' => $id,
                ]
            );

        $qb->setEnableHydrationCache($this->enableResultCache);
        $result = $qb->getQuery()->getOneOrNullResult($mode);

        return $result;
    }
1233601
public function filename($id)
    {
        if (isset($this->filenameCache[$id])) {
            return $this->filenameCache[$id];
        }

        $dir = $this->dir;
        $filename = $id;

        if ($this->subDirs) {
            $parts = explode(CacheCache\Cache::$namespaceSeparator, $id);
            $filename = array_pop($parts);
            $dir .= DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, $parts);
            if (!file_exists($dir)) {
                mkdir($dir, 0777, true);
            }
        }

        if (!$this->idAsFilename) {
            $filename = md5($filename);
        }

        if (!empty($this->fileExtension)) {
            $filename .= $this->fileExtension;
        }

        $filename = $dir . DIRECTORY_SEPARATOR . $filename;
        $this->filenameCache[$id] = $filename;
        return $filename;
    }
207762
private function getCacheEntity($id)
    {
        $contextual_id = $this->getContextualId($id);

        if (null === $this->_entity || $this->_entity->getId() !== $contextual_id) {
            $this->_entity = $this->_repository->find($contextual_id);
        }

        return $this->_entity;
    }
629826
public function get(string $id)
    {
        if (!$this->has($id)) {
            throw EntryNotFoundException::fromId($id);
        }

        return $this->cache[$id];
    }
690298
public function get($id)
    {
        $document = $this->getFileCollection()->findOne(['_id' => $id]);
        return empty($document) ? null : $this->createDownload($document);
    }
668747
protected function getFileName($id)
    {
        $directory = $this->getDirectory($id);
        $hash      = sha1($id, false);
        $file      = $directory . DIRECTORY_SEPARATOR . $hash . '.cache';
        return $file;
    }
1146896
public function getSubService($id, $interface = null)
    {
        if (! isset($this->subServices[$id])) {
            if ($this->hasOption($id)) {
                $service = $this->buildService($this->getOption($id), $interface);
                if ($service) {
                    $this->subServices[$id] = $service;
                } else {
                    throw new ServiceNotFoundException($id);
                }
            } else {
                throw new ServiceNotFoundException($id);
            }
        }
        return $this->subServices[$id];
    }
945034
static function subtreeCacheSubDir( $subtreeExpiryParameter, $cacheFilename )
    {
        $nodeID = eZTemplateCacheBlock::decodeNodeID( $subtreeExpiryParameter );
        return eZTemplateCacheBlock::calculateSubtreeCacheDir( $nodeID, $cacheFilename );
    }
630709
public function setSubdomainId( $id )
    {
        $this->subdomainId  = empty( $id ) ? null : (int) $id;
        $this->_uriCache    = null;
        return $this;
    }
582149
protected function _file($id)
    {
        $instance = self::getInstance();
        $fileNmae = $instance->_idToFileName($id);
        return self::cacheDir() . $fileNmae;
    }
1245908
protected static function cache_get_by_id($id) {
        if (isset(self::$cache_contextsbyid[$id])) {
            return self::$cache_contextsbyid[$id];
        }
        return false;
    }