Open Journal Systems  2.4.3
 All Classes Namespaces Functions Variables Groups Pages
MemcacheCache Class Reference
Inheritance diagram for MemcacheCache:
GenericCache

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

 $connection
 
 $expire
 
 $flag
 
- Public Attributes inherited from GenericCache
 $cacheId
 
 $context
 
 $fallback
 

Detailed Description

Provides caching based on Memcache.

See Also
GenericCache

Definition at line 30 of file MemcacheCache.inc.php.

Member Function Documentation

MemcacheCache::close ( )

Close the cache and free resources.

Definition at line 118 of file MemcacheCache.inc.php.

MemcacheCache::flush ( )

Flush the cache.

Definition at line 78 of file MemcacheCache.inc.php.

MemcacheCache::getCache (   $id)

Get an object from the cache.

Parameters
$id

Definition at line 86 of file MemcacheCache.inc.php.

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.inc.php.

MemcacheCache::MemcacheCache (   $context,
  $cacheId,
  $fallback,
  $hostname,
  $port 
)

Instantiate a cache.

Definition at line 49 of file MemcacheCache.inc.php.

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

MemcacheCache::setCache (   $id,
  $value 
)

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

Parameters
$id
$value

Definition at line 106 of file MemcacheCache.inc.php.

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 MemcacheCache.inc.php.

References setCache().

MemcacheCache::setExpiry (   $expiry)

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

Definition at line 71 of file MemcacheCache.inc.php.

MemcacheCache::setFlag (   $flag)

Set the flag (used in Memcache::set)

Definition at line 64 of file MemcacheCache.inc.php.

References $flag.

Member Data Documentation

MemcacheCache::$connection

Connection to use for caching.

Definition at line 34 of file MemcacheCache.inc.php.

MemcacheCache::$expire

Expiry (used by Memcache::set)

Definition at line 44 of file MemcacheCache.inc.php.

Referenced by setCache().

MemcacheCache::$flag

Flag (used by Memcache::set)

Definition at line 39 of file MemcacheCache.inc.php.

Referenced by setCache(), and setFlag().


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