Documentation home page

CFlickr.cache
Component DBCacheMySQL

cache.AbstractCache
  |
  +--cache.DBCacheMySQL

Caches responses from the Flickr API to a MySQL database.
Requires a table with the follow structure
CREATE TABLE `table_name` (
`id` varchar(32) NOT NULL,
`date` datetime NOT NULL,
`data` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Method Summary
public AbstractCache init(string dsn, string table, [string username=""], [string password=""], [numeric timeout="3600"])
public boolean existsInCache(struct params)
public any getFromCache(struct params)
public void purgeCache()
public void saveToCache(struct params, string data, [numeric cachefor="#variables.default_timeout#"])

Methods inherited from cache.AbstractCache
createHash
 

Method Detail

existsInCache

public boolean existsInCache(struct params)
Parameters:
struct params (Required)

getFromCache

public any getFromCache(struct params)
Parameters:
struct params (Required)

init

public CFlickr.cache.AbstractCache init(string dsn, string table, [string username=""], [string password=""], [numeric timeout="3600"])
Parameters:
string dsn (Required) - name of the dsn to use
string table (Required) - name of the table to store cached data in
string username="" (Optional) - username to connect to dadabase
string password="" (Optional) - password to connect to dadabase
numeric timeout="3600" (Optional) - seconds

purgeCache

public void purgeCache()

saveToCache

public void saveToCache(struct params, string data, [numeric cachefor="#variables.default_timeout#"])
Parameters:
struct params (Required)
string data (Required)
numeric cachefor="#variables.default_timeout#" (Optional) - cache response for this many seconds, if not supplied the default will be used