Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
MemcacheCache Class Reference
Inheritance diagram for MemcacheCache:

Public Member Functions

 close ()
 flush ()
 getCache ($id)
 getCacheTime ()
 MemcacheCache ($context, $cacheId, $fallback, $hostname, $port)
 setCache ($id, $value)
 setEntireCache (&$contents)
 setExpiry ($expiry)
 setFlag ($flag)
- Public Member Functions inherited from GenericCache
 close ()
 flush ()
 GenericCache ($context, $cacheId, $fallback)
 get ($id)
 getCache ($id)
 getCacheId ()
 getCacheTime ()
 getContext ()
 set ($id, $value)
 setCache ($id, $value)
 setEntireCache (&$contents)

Public Attributes

- Public Attributes inherited from GenericCache

Detailed Description

Provides caching based on Memcache.

See Also

Definition at line 30 of file

Member Function Documentation

MemcacheCache::close ( )

Close the cache and free resources.

Definition at line 118 of file

MemcacheCache::flush ( )

Flush the cache.

Definition at line 78 of file

MemcacheCache::getCache (   $id)

Get an object from the cache.


Definition at line 86 of file

References GenericCache\getCacheId(), and GenericCache\getContext().

MemcacheCache::getCacheTime ( )

Get the time at which the data was cached. Note that keys expire in memcache, which means that it's possible that the date will disappear before the data – in this case we'll have to assume the data is still good.

Definition at line 131 of file

MemcacheCache::MemcacheCache (   $context,

Instantiate a cache.

Definition at line 49 of file

References GenericCache\$cacheId, GenericCache\$context, and GenericCache\$fallback.

MemcacheCache::setCache (   $id,

Set an object in the cache. This function should be overridden by subclasses.


Definition at line 106 of file

References $expire, $flag, and GenericCache\getCacheId().

Referenced by setEntireCache().

MemcacheCache::setEntireCache ( $contents)

Set the entire contents of the cache. WARNING: THIS DOES NOT FLUSH THE CACHE FIRST! This is because there is no "scope restriction" for flushing within memcache and therefore a flush here would flush the entire cache, resulting in more subsequent calls to this function, resulting in more flushes, etc.

Definition at line 144 of file

References setCache().

MemcacheCache::setExpiry (   $expiry)

Set the expiry time (used in Memcache::set)

Definition at line 71 of file

MemcacheCache::setFlag (   $flag)

Set the flag (used in Memcache::set)

Definition at line 64 of file

References $flag.

Member Data Documentation


Connection to use for caching.

Definition at line 34 of file


Expiry (used by Memcache::set)

Definition at line 44 of file

Referenced by setCache().


Flag (used by Memcache::set)

Definition at line 39 of file

Referenced by setCache(), and setFlag().

The documentation for this class was generated from the following file: