Cachearium\Backend\CacheAPC::get PHP Method

get() public method

public get ( $base, $id, $sub = LH_DEFAULT_CACHE_ID )
    public function get($base, $id, $sub = LH_DEFAULT_CACHE_ID)
    {
        // @codeCoverageIgnoreStart
        if (!$this->enabled) {
            throw new NotCachedException();
        }
        // @codeCoverageIgnoreEnd
        if (!is_string($sub)) {
            $sub = md5(serialize($sub));
        }
        $this->checkValidArgs($base, $id, $sub);
        $key = (new CacheKey($base, $id, $sub))->getHash();
        $success = false;
        $data = apc_fetch($key, $success);
        if (!$success) {
            $this->log(CacheLogEnum::MISSED, $base, $id, $sub);
            throw new NotCachedException();
        }
        return $data;
    }