Back to Joomla project (class list)

Class Cache - list of methods

Joomla! Cache base object
Package: Joomla\CMS\Cache
Copyright: (C) 2005 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
Located at: Joomla/Cache/Cache.php
Project: Joomla

Method Summary

public
(mixed $options)

Constructor
Parameters
  • array $options Cache options
Since
  • 1.7.0
Show source code of this method: __construct Source Code

public static \Joomla\CMS\Cache\CacheController
(mixed $type = 'output', mixed $options = array())

Returns a reference to a cache adapter object, always creating it
Parameters
  • string $type The cache object type to instantiate
  • array $options The array of options
Returns
  • \Joomla\CMS\Cache\CacheController
Since
  • 1.7.0
Deprecated
  • 5.0
Show source code of this method: getInstance Source Code

public static array
()

Get the storage handlers
Returns
  • array
Since
  • 1.7.0
Show source code of this method: getStores Source Code

public void
(mixed $enabled)

Set caching enabled state
Parameters
  • bool $enabled True to enable caching
Returns
  • void
Since
  • 1.7.0
Show source code of this method: setCaching Source Code

public bool
()

Get caching state
Returns
  • bool
Since
  • 1.7.0
Show source code of this method: getCaching Source Code

public void
(mixed $lt)

Set cache lifetime
Parameters
  • int $lt Cache lifetime
Returns
  • void
Since
  • 1.7.0
Show source code of this method: setLifeTime Source Code

public bool
(mixed $id, mixed $group = null)

Check if the cache contains data stored by ID and group
Parameters
  • string $id The cache data ID
  • string $group The cache data group
Returns
  • bool
Since
  • 3.7.0
Show source code of this method: contains Source Code

public mixed
(mixed $id, mixed $group = null)

Get cached data by ID and group
Parameters
  • string $id The cache data ID
  • string $group The cache data group
Returns
  • mixed Boolean false on failure or a cached data object
Since
  • 1.7.0
Show source code of this method: get Source Code

public mixed
()

Get a list of all cached data
Returns
  • mixed Boolean false on failure or an object with a list of cache groups and data
Since
  • 1.7.0
Show source code of this method: getAll Source Code

public bool
(mixed $data, mixed $id, mixed $group = null)

Store the cached data by ID and group
Parameters
  • mixed $data The data to store
  • string $id The cache data ID
  • string $group The cache data group
Returns
  • bool
Since
  • 1.7.0
Show source code of this method: store Source Code

public bool
(mixed $id, mixed $group = null)

Remove a cached data entry by ID and group
Parameters
  • string $id The cache data ID
  • string $group The cache data group
Returns
  • bool
Since
  • 1.7.0
Show source code of this method: remove Source Code

public bool
(mixed $group = null, mixed $mode = 'group')

Clean cache for a group given a mode.
Parameters
  • string $group The cache data group
  • string $mode The mode for cleaning cache [group|notgroup]
Returns
  • bool True on success, false otherwise
Since
  • 1.7.0
Show source code of this method: clean Source Code

public bool
()

Garbage collect expired cache data
Returns
  • bool
Since
  • 1.7.0
Show source code of this method: gc Source Code

public \stdClass
(mixed $id, mixed $group = null, mixed $locktime = null)

Set lock flag on cached item
Parameters
  • string $id The cache data ID
  • string $group The cache data group
  • string $locktime The default locktime for locking the cache.
Returns
  • \stdClass Object with properties of lock and locklooped
Since
  • 1.7.0
Show source code of this method: lock Source Code

public bool
(mixed $id, mixed $group = null)

Unset lock flag on cached item
Parameters
  • string $id The cache data ID
  • string $group The cache data group
Returns
  • bool
Since
  • 1.7.0
Show source code of this method: unlock Source Code

public \Joomla\CMS\Cache\CacheStorage
()

Get the cache storage handler
Returns
  • \Joomla\CMS\Cache\CacheStorage
Since
  • 1.7.0
Show source code of this method: _getStorage Source Code

public static string
(mixed $data, mixed $options = array())

Perform workarounds on retrieved cached data
Parameters
  • array $data Cached data
  • array $options Array of options
Returns
  • string Body of cached data
Since
  • 1.7.0
Show source code of this method: getWorkarounds Source Code

public static array
(mixed $data, mixed $options = [])

Create workarounds for data to be cached
Parameters
  • string $data Cached data
  • array $options Array of options
Returns
  • array Data to be cached
Since
  • 1.7.0
Show source code of this method: setWorkarounds Source Code

public static string
()

Create a safe ID for cached data from URL parameters
Returns
  • string MD5 encoded cache ID
Since
  • 1.7.0
Show source code of this method: makeId Source Code

public static string
()

Set a prefix cache key if device calls for separate caching
Returns
  • string
Since
  • 3.5
Show source code of this method: getPlatformPrefix Source Code

public static array
(mixed $path = '')

Add a directory where Cache should search for handlers. You may either pass a string or an array of directories.
Parameters
  • array|string $path A path to search.
Returns
  • array An array with directory elements
Since
  • 1.7.0
Show source code of this method: addIncludePath Source Code

Properties Summary

public static \Joomla\CMS\Cache\CacheStorage[]
$_handler
Storage handler
Since
  • 1.7.0
public array
$_options
Cache options
Since
  • 1.7.0

Tags Summary

Since
1.7.0