Static Public Member Functions | Protected Member Functions | Static Protected Attributes

Cache Class Reference

Inheritance diagram for Cache:

List of all members.

Static Public Member Functions

static __static ()
static has ($name)
static has_group ($group)
static get ($name)
static get_group ($group)
static set ($name, $value, $expiry=3600, $keep=false)
static expire ($name, $match_mode= 'strict')
static expired ($name)
static extend ($name, $expiry)
static debug ()
static purge ()
static get_class ()

Protected Member Functions

 _has ($name, $group)
 _has_group ($group)
 _get ($name, $group)
 _get_group ($group)
 _set ($name, $value, $expiry, $group, $keep)
 _expire ($name, $group)
 _expired ($name, $group)
 _extend ($name, $expiry, $group)

Static Protected Attributes

static $default_group = 'default'
static $instance
static $cache_class

Detailed Description

Habari Cache Class

Base abstract class for caching computationally expensive or bandwidth intensive data

Definition at line 14 of file cache.php.


Member Function Documentation

static Cache::__static (  )  [static]

Set up the static cache instance in __autoload()

Definition at line 23 of file cache.php.

Cache::_expire ( name,
group 
) [abstract, protected]

A cache instance implements this to expire the named value from the cache.

Parameters:
string $name The name of the cached item
Cache::_expired ( name,
group 
) [abstract, protected]

A cache instance implements this to expire the named value from the cache.

Parameters:
string $name The name of the cached item

Reimplemented in APCCache, DisabledCache, FileCache, and MemcacheCache.

Cache::_extend ( name,
expiry,
group 
) [abstract, protected]

A cache instance implements this to extend the expiration of the named cached value.

Parameters:
string $name The name of the cached item
integer $expiry The duration in seconds to extend the cache expiration by

Reimplemented in APCCache, DisabledCache, FileCache, and MemcacheCache.

Cache::_get ( name,
group 
) [abstract, protected]

A cache instance implements this to return the named value from the cache.

Parameters:
string $name The name of the cached item
Returns:
mixed The item value or null if it doesn't exist in cache

Reimplemented in APCCache, DisabledCache, FileCache, and MemcacheCache.

Cache::_get_group ( group  )  [abstract, protected]

A cache instance implements this to return the group from the cache.

Parameters:
string $name The name of the cached group
Returns:
mixed The item value or null if it doesn't exist in cache

Reimplemented in APCCache, DisabledCache, FileCache, and MemcacheCache.

Cache::_has ( name,
group 
) [abstract, protected]

A cache instance implements this function to return whether a named cache exists.

Parameters:
string $name The name of the cached item
Returns:
boolean true if the item is cached, false if not

Reimplemented in APCCache, DisabledCache, FileCache, and MemcacheCache.

Cache::_has_group ( group  )  [abstract, protected]

A cache instance implements this function to return whether a group exists.

Parameters:
string $name The name of the cached group
Returns:
boolean true if the group is cached, false if not

Reimplemented in APCCache, DisabledCache, FileCache, and MemcacheCache.

Cache::_set ( name,
value,
expiry,
group,
keep 
) [abstract, protected]

A cache instance implements this to set the named value in the cache with an expiration.

Parameters:
string $name The name of the cached item
mixed $value The value to store
integer $expiry Number of second after the call that the cache will expire

Reimplemented in APCCache, DisabledCache, FileCache, and MemcacheCache.

static Cache::expire ( name,
match_mode = 'strict' 
) [static]

Expires the named value from the cache.

Parameters:
mixed $name The name of the cached item or an array of array( string $group, string $name )
string $match_mode (optional) how to match item names ('strict', 'regex', 'glob') (default 'strict')

Definition at line 162 of file cache.php.

static Cache::expired ( name  )  [static]

Check if a named value in the cache has expired.

Parameters:
mixed $name The name of the cached item or an array of array( string $group, string $name )

Definition at line 187 of file cache.php.

static Cache::extend ( name,
expiry 
) [static]

Extend the expiration of the named cached value.

Parameters:
mixed $name The name of the cached item or an array of array( string $group, string $name )
integer $expiry The duration in seconds to extend the cache expiration by

Definition at line 213 of file cache.php.

static Cache::get ( name  )  [static]

Returns the named value from the cache.

Parameters:
mixed $name The name of the cached item or an array of array( string $group, string $name )
Returns:
mixed The item value or null if it doesn't exist in cache

Definition at line 83 of file cache.php.

Referenced by MemcacheCache::__construct(), APCCache::__construct(), __static(), AtomHandler::act_introspection(), and AtomHandler::act_rsd().

static Cache::get_class (  )  [static]

Retrieve the class used for caching

Returns:
string The class used for caching

Definition at line 249 of file cache.php.

Referenced by AdminHandler::get_sysinfo().

static Cache::get_group ( group  )  [static]

Returns the group from the cache.

Parameters:
string $name The name of the cached group
Returns:
mixed The item value or null if it doesn't exist in cache

Definition at line 110 of file cache.php.

static Cache::has ( name  )  [static]

Is record with $name in the cache?

Parameters:
mixed $name name of the cached item or an array of array( string $group, string $name )
Returns:
boolean true if item is cached, false if not

Definition at line 36 of file cache.php.

Referenced by AtomHandler::act_introspection(), and AtomHandler::act_rsd().

static Cache::has_group ( group  )  [static]

Is group in the cache?

Parameters:
string $group name of the cached group
Returns:
boolean true if group is cached, false if not

Definition at line 63 of file cache.php.

static Cache::purge (  )  [static]

Empty the cache completely

Definition at line 240 of file cache.php.

Referenced by InstallHandler::upgrade_db().

static Cache::set ( name,
value,
expiry = 3600,
keep = false 
) [static]

Set the named value in the cache with an expiration.

Parameters:
mixed $name The name of the cached item or an array of array( string $group, string $name )
mixed $value The value to store
integer $expiry Number of second after the call that the cache will expire
boolean $keep If true, retain the cache value even after expiry but report the cache as expired

Definition at line 133 of file cache.php.

Referenced by AtomHandler::act_introspection(), and AtomHandler::act_rsd().


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