Moodle  2.2.1
http://www.collinsharper.com
Minify_Cache_Memcache Class Reference

Public Member Functions

 __construct ($memcache, $expire=0)
 store ($id, $data)
 getSize ($id)
 isValid ($id, $srcMtime)
 display ($id)
 fetch ($id)

Detailed Description

Memcache-based cache class for Minify

// fall back to disk caching if memcache can't connect $memcache = new Memcache; if ($memcache->connect('localhost', 11211)) { Minify::setCache(new Minify_Cache_Memcache($memcache)); } else { Minify::setCache(); }

Definition at line 20 of file Memcache.php.


Constructor & Destructor Documentation

__construct ( memcache,
expire = 0 
)

Create a Minify_Cache_Memcache object, to be passed to Minify::setCache().

Parameters:
Memcache$memcachealready-connected instance
int$expireseconds until expiration (default = 0 meaning the item will not get an expiration date)
Returns:
null

Definition at line 33 of file Memcache.php.


Member Function Documentation

display ( id)

Send the cached content to output

Parameters:
string$idcache id

Definition at line 87 of file Memcache.php.

fetch ( id)

Fetch the cached content

Parameters:
string$idcache id
Returns:
string

Definition at line 101 of file Memcache.php.

getSize ( id)

Get the size of a cache entry

Parameters:
string$idcache id
Returns:
int size in bytes

Definition at line 61 of file Memcache.php.

isValid ( id,
srcMtime 
)

Does a valid cache entry exist?

Parameters:
string$idcache id
int$srcMtimemtime of the original source file(s)
Returns:
bool exists

Definition at line 77 of file Memcache.php.

store ( id,
data 
)

Write data to cache.

Parameters:
string$idcache id
string$data
Returns:
bool success

Definition at line 48 of file Memcache.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations