Class CalendarSolution_Cache_Memcache

Description

Implements interfaces:

Calendar Solution's memcache methods

NOTE: the cache is flushed when administrators edit events.

Located in /include/CalendarSolution/Cache/Memcache.php (line 22)


	
			
Variable Summary
Memcache $cache
Method Summary
CalendarSolution_Cache_Memcache __construct ()
bool flush ()
mixed get (string $key)
bool set (string $key, mixed $value)
Variables
Memcache $cache (line 27)

The cache connection

  • access: protected
int $expiration_time (line 40)

The Unix timestamp of when the cache should expire.

Should be set to 00:00:01 tomorrow. This is because many views use the current date as the starting point, so when tomorrow rolls around, today's data is no longer needed.

NOTE: the cache is also flushed when administrators edit events.

Methods
Constructor __construct (line 51)

Calls memcache's addServer() for each server listed in $GLOBALS['cache_servers']

  • throws: CalendarSolution_Exception if the memcache extension is not installed or if adding one of the cache servers fails
  • access: public
  • uses: $GLOBALS['cache_servers'] - to know where the cache servers are
CalendarSolution_Cache_Memcache __construct ()
flush (line 73)

Flush all data from the cache

  • access: public
bool flush ()

Implementation of:
CalendarSolution_Cache::flush()
Flush all data from the cache
get (line 84)

Obtains data from the cache

  • return: the data on success, false on failure
  • access: public
mixed get (string $key)
  • string $key: the data element's name

Implementation of:
CalendarSolution_Cache::get()
Obtains data from the cache
set (line 102)

Stores data in the cache

If $expiration_time has not been set, this method sets it to 00:00:01 tomorrow.

bool set (string $key, mixed $value)
  • string $key: the data element's name
  • mixed $value: the data to be stored

Implementation of:
CalendarSolution_Cache::set()
Stores data in the cache

Documentation generated on Wed, 21 Mar 2012 14:16:44 -0400 by phpDocumentor 1.4.4