Caches data to a MySQL database

Registered for URLs with the "mysql" protocol

For example, mysql://root:password@localhost:3306/mydb?prefix=sp_ will connect to the mydb database on localhost on port 3306, with the user root and the password password. All tables will be prefixed with sp_

package SimplePie
subpackage Caching
inherited_from \SimplePie_Cache_DB

 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

Helper for database conversion

prepare_simplepie_object_for_cache(\SimplePie $data) : array
InheritedStatic

Converts a given \SimplePie object into data to be stored

Parameters

$data

\SimplePie

Returns

arrayFirst item is the serialized data for storage, second item is the unique ID for this item

 Properties

 

Cache ID

$id : string

Default

 

PDO instance

$mysql : \PDO

Default

 

Options

$options : array

Default