Class JCache

Description

Joomla! Cache base object

  • since: 11.1

Located in /libraries/joomla/cache/cache.php (line 27)

JObject
   |
   --JCache
Variable Summary
static object Storage $_handler
array $_options
Method Summary
static array addIncludePath ([string $path = ''])
static JCache getInstance ([string $type = 'output'], [array $options = array()])
static array getStores ()
static string getWorkarounds (string $data, [array $options = array()])
static string makeId ()
static string setWorkarounds (string $data, [array $options = array()])
JCache __construct (array $options)
boolean clean ([string $group = null], [string $mode = 'group'])
boolean gc ()
mixed get (string $id, [string $group = null])
mixed getAll ()
boolean getCaching ()
object Properties lock (string $id, [string $group = null], [string $locktime = null])
boolean remove (string $id, [string $group = null])
void setCaching (boolean $enabled)
void setLifeTime (integer $lt)
boolean store (mixed $data, string $id, [string $group = null])
boolean unlock (string $id, [string $group = null])
Variables
static object Storage $_handler = array() (line 33)
  • var: handler
  • since: 11.1
  • access: public
array $_options (line 39)
  • var: Options
  • since: 11.1
  • access: public

Inherited Variables

Inherited from JObject

JObject::$_errors
Methods
static method addIncludePath (line 680)

Add a directory where JCache should search for handlers. You may either pass a string or an array of directories.

  • return: An array with directory elements
  • since: 11.1
  • access: public
static array addIncludePath ([string $path = ''])
  • string $path: A path to search.
static method getInstance (line 88)

Returns a reference to a cache adapter object, always creating it

  • return: A JCache object
  • since: 11.1
  • access: public
static JCache getInstance ([string $type = 'output'], [array $options = array()])
  • string $type: The cache object type to instantiate
  • array $options: The array of options
static method getStores (line 100)

Get the storage handlers

  • return: An array of available storage handlers
  • since: 11.1
  • access: public
static array getStores ()
static method getWorkarounds (line 455)

Perform workarounds on retrieved cached data

  • return: Body of cached data
  • since: 11.1
  • access: public
static string getWorkarounds (string $data, [array $options = array()])
  • string $data: Cached data
  • array $options: Array of options
static method makeId (line 635)

Create safe id for cached data from url parameters set by plugins and framework

  • return: md5 encoded cacheid
  • since: 11.1
  • access: public
static string makeId ()
static method setWorkarounds (line 516)

Create workarounded data to be cached

  • return: Data to be cached
  • since: 11.1
  • access: public
static string setWorkarounds (string $data, [array $options = array()])
  • string $data: Cached data
  • array $options: Array of options
Constructor __construct (line 48)

Constructor

  • since: 11.1
  • access: public
JCache __construct (array $options)
  • array $options: options

Redefinition of:
JObject::__construct()
Class constructor, overridden in descendant classes.
clean (line 270)

Clean cache for a group given a mode.

group mode : cleans all cache in the group notgroup mode : cleans all cache not in the group

  • return: True on success, false otherwise
  • since: 11.1
  • access: public
boolean clean ([string $group = null], [string $mode = 'group'])
  • string $group: The cache data group
  • string $mode: The mode for cleaning cache [group|notgroup]
gc (line 291)

Garbage collect expired cache data

  • return: True on success, false otherwise.
  • since: 11.1
  • access: public
boolean gc ()
get (line 175)

Get cached data by id and group

  • return: boolean False on failure or a cached data string
  • since: 11.1
  • access: public
mixed get (string $id, [string $group = null])
  • string $id: The cache data id
  • string $group: The cache data group

Redefinition of:
JObject::get()
Returns a property of the object or the default value if the property is not set.
getAll (line 196)

Get a list of all cached data

  • return: Boolean false on failure or an object with a list of cache groups and data
  • since: 11.1
  • access: public
mixed getAll ()
getCaching (line 146)

Get caching state

  • return: Caching state
  • since: 11.1
  • access: public
boolean getCaching ()
lock (line 313)

Set lock flag on cached item

  • return: are lock and locklooped
  • since: 11.1
  • access: public
object Properties lock (string $id, [string $group = null], [string $locktime = null])
  • string $id: The cache data id
  • string $group: The cache data group
  • string $locktime: The default locktime for locking the cache.
remove (line 243)

Remove a cached data entry by id and group

  • return: True on success, false otherwise
  • since: 11.1
  • access: public
boolean remove (string $id, [string $group = null])
  • string $id: The cache data id
  • string $group: The cache data group
setCaching (line 134)

Set caching enabled state

  • since: 11.1
  • access: public
void setCaching (boolean $enabled)
  • boolean $enabled: True to enable caching
setLifeTime (line 160)

Set cache lifetime

  • since: 11.1
  • access: public
void setLifeTime (integer $lt)
  • integer $lt: Cache lifetime
store (line 218)

Store the cached data by id and group

  • return: True if cache stored
  • since: 11.1
  • access: public
boolean store (mixed $data, string $id, [string $group = null])
  • mixed $data: The data to store
  • string $id: The cache data id
  • string $group: The cache data group
unlock (line 398)

Unset lock flag on cached item

  • return: True on success, false otherwise.
  • since: 11.1
  • access: public
boolean unlock (string $id, [string $group = null])
  • string $id: The cache data id
  • string $group: The cache data group
_getStorage (line 431)

Get the cache storage handler

  • return: A JCacheStorage object
  • since: 11.1
  • access: public
JCacheStorage &_getStorage ()

Inherited Methods

Inherited From JObject

JObject::__construct()
JObject::def()
JObject::get()
JObject::getError()
JObject::getErrors()
JObject::getProperties()
JObject::set()
JObject::setError()
JObject::setProperties()
JObject::toString()
JObject::__toString()

Documentation generated on Mon, 25 Jun 2012 13:52:40 -0500 by phpDocumentor 1.4.4