JCache

Joomla! Cache base object

since

11.1

package

Joomla.Platform

Methods

__construct

Constructor

__construct(array $options) 
since

11.1

Arguments

$options

arrayCache options

_getStorage

Get the cache storage handler

_getStorage() : \JCacheStorage
since

11.1

Response

\JCacheStorage

addIncludePath

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

addIncludePath(array|string $path = '') : array
static
since

11.1

Arguments

$path

array|stringA path to search.

Response

arrayAn array with directory elements

clean

Clean cache for a group given a mode.

clean(string $group = null, string $mode = 'group') : boolean

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

since

11.1

Arguments

$group

stringThe cache data group

$mode

stringThe mode for cleaning cache [group|notgroup]

Response

booleanTrue on success, false otherwise

contains

Check if the cache contains data stored by ID and group

contains(string $id, string $group = null) : boolean
since

3.7.0

Arguments

$id

stringThe cache data ID

$group

stringThe cache data group

Response

boolean

gc

Garbage collect expired cache data

gc() : boolean
since

11.1

Response

boolean

get

Get cached data by ID and group

get(string $id, string $group = null) : mixed
since

11.1

Arguments

$id

stringThe cache data ID

$group

stringThe cache data group

Response

mixedBoolean false on failure or a cached data object

getAll

Get a list of all cached data

getAll() : mixed
since

11.1

Response

mixedBoolean false on failure or an object with a list of cache groups and data

getCaching

Get caching state

getCaching() : boolean
since

11.1

Response

boolean

getInstance

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

getInstance(string $type = 'output', array $options = array()) : \JCacheController
static
since

11.1

Arguments

$type

stringThe cache object type to instantiate

$options

arrayThe array of options

Response

\JCacheController

getPlatformPrefix

Set a prefix cache key if device calls for separate caching

getPlatformPrefix() : string
static
since

3.5

Response

string

getStores

Get the storage handlers

getStores() : array
static
since

11.1

Response

array

getWorkarounds

Perform workarounds on retrieved cached data

getWorkarounds(string $data, array $options = array()) : string
static
since

11.1

Arguments

$data

stringCached data

$options

arrayArray of options

Response

stringBody of cached data

lock

Set lock flag on cached item

lock(string $id, string $group = null, string $locktime = null) : \stdClass
since

11.1

Arguments

$id

stringThe cache data ID

$group

stringThe cache data group

$locktime

stringThe default locktime for locking the cache.

Response

\stdClassObject with properties of lock and locklooped

makeId

Create a safe ID for cached data from URL parameters

makeId() : string
static
since

11.1

Response

stringMD5 encoded cache ID

remove

Remove a cached data entry by ID and group

remove(string $id, string $group = null) : boolean
since

11.1

Arguments

$id

stringThe cache data ID

$group

stringThe cache data group

Response

boolean

setCaching

Set caching enabled state

setCaching(boolean $enabled) : void
since

11.1

Arguments

$enabled

booleanTrue to enable caching

setLifeTime

Set cache lifetime

setLifeTime(integer $lt) : void
since

11.1

Arguments

$lt

integerCache lifetime

setWorkarounds

Create workarounds for data to be cached

setWorkarounds(string $data, array $options = array()) : string
static
since

11.1

Arguments

$data

stringCached data

$options

arrayArray of options

Response

stringData to be cached

store

Store the cached data by ID and group

store(mixed $data, string $id, string $group = null) : boolean
since

11.1

Arguments

$data

mixedThe data to store

$id

stringThe cache data ID

$group

stringThe cache data group

Response

boolean

unlock

Unset lock flag on cached item

unlock(string $id, string $group = null) : boolean
since

11.1

Arguments

$id

stringThe cache data ID

$group

stringThe cache data group

Response

boolean

Properties

_handler

Storage handler

static

Type(s)

array<mixed,\JCacheStorage>

_options

Cache options

Type(s)

array