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;
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