public function fetch($id)
    {
        if (!file_exists($this->filename($id))) {
            return false;
        }

        $filedata = file_get_contents($this->filename($id));
        $data = json_decode($filedata, true);
        if ($data['ttl'] !== null) {
            if (($data['time'] + $data['ttl']) < time()) {
                return false;
            }
        }

        return $data['data'];
    }
public function fetch($id)
    {
        if (!file_exists($this->filename($id))) {
            return false;
        }

        $filedata = file_get_contents($this->filename($id));
        $data = json_decode($filedata, true);
        if ($data['ttl'] !== null) {
            if (($data['time'] + $data['ttl']) < time()) {
                return false;
            }
        }

        return $data['data'];
    }
public function fetch ( $ id ) { if ( ! file_exists ( $ this -> filename ( $ id ) ) ) { return false ; } $ filedata = file_get_contents ( $ this -> filename ( $ id ) ) ; $ data = json_decode ( $ filedata , true ) ; if ( $ data [ 'ttl' ] !== null ) { if ( ( $ data [ 'time' ] + $ data [ 'ttl' ] ) < time ( ) ) { return false ; } } return $ data [ 'data' ] ; }
Fetches an entry from the cache or returns false if not exists.

@param string $id

@return string|false
Fetches an entry from the cache or returns false if not exists .