Open Journal Systems  3.3.0
MemcacheCache Class Reference
Inheritance diagram for MemcacheCache:
GenericCache

Public Member Functions

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

Data Fields

 $connection
 
 $expire
 
 $flag
 
- Data Fields inherited from GenericCache
 $cacheId
 
 $cacheMiss
 
 $context
 
 $fallback
 

Detailed Description

Provides caching based on Memcache.

See also
GenericCache

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

Constructor & Destructor Documentation

◆ __construct()

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

Instantiate a cache.

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

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

Member Function Documentation

◆ close()

MemcacheCache::close ( )

Close the cache and free resources.

Reimplemented from GenericCache.

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

◆ flush()

MemcacheCache::flush ( )

Flush the cache.

Reimplemented from GenericCache.

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

◆ getCache()

MemcacheCache::getCache (   $id)

Get an object from the cache.

Parameters
$id

Reimplemented from GenericCache.

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

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

◆ getCacheTime()

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.

Reimplemented from GenericCache.

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

◆ setCache()

MemcacheCache::setCache (   $id,
  $value 
)

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

Parameters
$id
$value

Reimplemented from GenericCache.

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

Referenced by setEntireCache().

◆ 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.

Reimplemented from GenericCache.

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

References setCache().

◆ setExpiry()

MemcacheCache::setExpiry (   $expiry)

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

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

◆ setFlag()

MemcacheCache::setFlag (   $flag)

Set the flag (used in Memcache::set)

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

References $flag.

Field Documentation

◆ $connection

MemcacheCache::$connection

Connection to use for caching.

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

◆ $expire

MemcacheCache::$expire

Expiry (used by Memcache::set)

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

◆ $flag

MemcacheCache::$flag

Flag (used by Memcache::set)

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

Referenced by setFlag().


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