Cachearium\Backend\CacheFilesystem::get PHP Method

get() public method

(non-PHPdoc)
public get ( CacheKey $k )
$k Cachearium\CacheKey
    public function get(CacheKey $k)
    {
        // @codeCoverageIgnoreStart
        if (!$this->enabled) {
            throw new \Cachearium\Exceptions\NotCachedException();
        }
        // @codeCoverageIgnoreEnd
        $group = $this->hashKey($k);
        if (!is_string($k->sub)) {
            $cacheid = md5(serialize($k->sub));
        } else {
            $cacheid = $k->sub;
        }
        $retval = $this->cache->get($cacheid, $group);
        $this->log($retval !== false ? CacheLogEnum::ACCESSED : CacheLogEnum::MISSED, $k);
        if ($retval) {
            return unserialize($retval);
        }
        throw new \Cachearium\Exceptions\NotCachedException();
    }