Base for cache objects

Classes to be used with \SimplePie_Cache::register() are expected to implement this interface.

package SimplePie
subpackage Caching

 Methods

Create a new cache object

__construct(string $location, string $name, string $type) 

Parameters

$location

string

Location string (from SimplePie::$cache_location)

$name

string

Unique ID for the cache

$type

string

Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data

Retrieve the data saved to the cache

load() : array

Returns

arrayData for SimplePie::$data

Retrieve the last modified time for the cache

mtime() : integer

Returns

integerTimestamp

Save data to the cache

save(array|\SimplePie $data) : boolean

Parameters

$data

array\SimplePie

Data to store in the cache. If passed a SimplePie object, only cache the $data property

Returns

booleanSuccessfulness

Set the last modified time to the current time

touch() : boolean

Returns

booleanSuccess status

 Constants

 

Feed cache type

TYPE_FEED = 'spc' : string
 

Image cache type

TYPE_IMAGE = 'spi' : string