\Guzzle\CacheCacheAdapterInterface

Interface for cache adapters.

Cache adapters allow Guzzle to utilize various frameworks for caching HTTP responses.

Summary

Methods
Constants
contains()
delete()
fetch()
save()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

contains()

contains(string  $id, array  $options = null) : boolean

Test if an entry exists in the cache.

Parameters

string $id

cache id The cache id of the entry to check for.

array $options

Array of cache adapter options

Returns

boolean —

Returns TRUE if a cache entry exists for the given cache id, FALSE otherwise.

delete()

delete(string  $id, array  $options = null) : boolean

Deletes a cache entry.

Parameters

string $id

cache id

array $options

Array of cache adapter options

Returns

boolean —

TRUE on success, FALSE on failure

fetch()

fetch(string  $id, array  $options = null) : string

Fetches an entry from the cache.

Parameters

string $id

cache id The id of the cache entry to fetch.

array $options

Array of cache adapter options

Returns

string —

The cached data or FALSE, if no cache entry exists for the given id.

save()

save(string  $id, string  $data, integer|boolean  $lifeTime = false, array  $options = null) : boolean

Puts data into the cache.

Parameters

string $id

The cache id

string $data

The cache entry/data

integer|boolean $lifeTime

The lifetime. If != false, sets a specific lifetime for this cache entry

array $options

Array of cache adapter options

Returns

boolean —

TRUE if the entry was successfully stored in the cache, FALSE otherwise.