Cache
Joomla! Cache base object
since |
1.7.0 |
---|---|
package |
Joomla CMS |
Methods
__construct
Constructor
__construct(array options) : mixed
since |
1.7.0 |
---|
Arguments
- options
array
Cache options
Response
mixed
_getStorage
Get the cache storage handler
_getStorage() : \Joomla\CMS\Cache\CacheStorage
since |
1.7.0 |
---|
Response
\Joomla\CMS\Cache\CacheStorage
addIncludePath
Add a directory where Cache should search for handlers. You may either pass a string or an array of directories.
addIncludePath(array|string path = '') : array
since |
1.7.0 |
---|
Arguments
- path
array|string
A path to search.
Response
array
An array with directory elements
clean
Clean cache for a group given a mode.
clean(string group = null, string mode = 'group') : bool
group mode : cleans all cache in the group notgroup mode : cleans all cache not in the group
since |
1.7.0 |
---|
Arguments
- group
string
The cache data group- mode
string
The mode for cleaning cache [group|notgroup]
Response
bool
True on success, false otherwise
contains
Check if the cache contains data stored by ID and group
contains(string id, string group = null) : bool
since |
3.7.0 |
---|
Arguments
- id
string
The cache data ID- group
string
The cache data group
Response
bool
gc
Garbage collect expired cache data
gc() : bool
since |
1.7.0 |
---|
Response
bool
get
Get cached data by ID and group
get(string id, string group = null) : mixed
since |
1.7.0 |
---|
Arguments
- id
string
The cache data ID- group
string
The cache data group
Response
mixed
Boolean false on failure or a cached data object
getAll
Get a list of all cached data
getAll() : mixed
since |
1.7.0 |
---|
Response
mixed
Boolean false on failure or an object with a list of cache groups and data
getCaching
Get caching state
getCaching() : bool
since |
1.7.0 |
---|
Response
bool
getInstance
Returns a reference to a cache adapter object, always creating it
getInstance(string type = 'output', array options = array()) : \Joomla\CMS\Cache\CacheController
since |
1.7.0 |
---|---|
deprecated |
5.0 Use the cache controller factory instead |
Arguments
- type
string
The cache object type to instantiate- options
array
The array of options
Response
\Joomla\CMS\Cache\CacheController
getPlatformPrefix
Set a prefix cache key if device calls for separate caching
getPlatformPrefix() : string
since |
3.5 |
---|
Response
string
getStores
Get the storage handlers
getStores() : array
since |
1.7.0 |
---|
Response
array
getWorkarounds
Perform workarounds on retrieved cached data
getWorkarounds(array data, array options = array()) : string
since |
1.7.0 |
---|
Arguments
- data
array
Cached data- options
array
Array of options
Response
string
Body of cached data
lock
Set lock flag on cached item
lock(string id, string group = null, string locktime = null) : \stdClass
since |
1.7.0 |
---|
Arguments
- id
string
The cache data ID- group
string
The cache data group- locktime
string
The default locktime for locking the cache.
Response
\stdClass
Object with properties of lock and locklooped
makeId
Create a safe ID for cached data from URL parameters
makeId() : string
since |
1.7.0 |
---|
Response
string
MD5 encoded cache ID
remove
Remove a cached data entry by ID and group
remove(string id, string group = null) : bool
since |
1.7.0 |
---|
Arguments
- id
string
The cache data ID- group
string
The cache data group
Response
bool
setCaching
Set caching enabled state
setCaching(bool enabled) : void
since |
1.7.0 |
---|
Arguments
- enabled
bool
True to enable caching
setLifeTime
Set cache lifetime
setLifeTime(int lt) : void
since |
1.7.0 |
---|
Arguments
- lt
int
Cache lifetime
setWorkarounds
Create workarounds for data to be cached
setWorkarounds(string data, array options = []) : array
since |
1.7.0 |
---|
Arguments
- data
string
Cached data- options
array
Array of options
Response
array
Data to be cached
store
Store the cached data by ID and group
store(mixed data, string id, string group = null) : bool
since |
1.7.0 |
---|
Arguments
- data
mixed
The data to store- id
string
The cache data ID- group
string
The cache data group
Response
bool
unlock
Unset lock flag on cached item
unlock(string id, string group = null) : bool
since |
1.7.0 |
---|
Arguments
- id
string
The cache data ID- group
string
The cache data group
Response
bool