API17:JCache
From Joomla! Documentation
(Difference between revisions)
(Bulk upload by Doxiki2) |
m (→User contributed notes: bad link repair) |
||
| (2 intermediate revisions by one user not shown) | |||
| Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
| + | =={{JVer|11.1}} JCache== | ||
| + | ===Description=== | ||
| + | {{Description:JCache}} | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
<nowiki>[</nowiki>[[Description:JCache|Edit Descripton]]<nowiki>]</nowiki> | <nowiki>[</nowiki>[[Description:JCache|Edit Descripton]]<nowiki>]</nowiki> | ||
</span> | </span> | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
===Methods=== | ===Methods=== | ||
{| class="wikitable sortable" | {| class="wikitable sortable" | ||
|- | |- | ||
| + | !Visibility | ||
!Method name | !Method name | ||
!Description | !Description | ||
|- | |- | ||
| + | |public | ||
|[[JCache::__construct/11.1|__construct]] | |[[JCache::__construct/11.1|__construct]] | ||
|Constructor. | |Constructor. | ||
|- | |- | ||
| + | |public | ||
|[[JCache::_getStorage/11.1|_getStorage]] | |[[JCache::_getStorage/11.1|_getStorage]] | ||
|Get the cache storage handler. | |Get the cache storage handler. | ||
|- | |- | ||
| + | |public | ||
|[[JCache::clean/11.1|clean]] | |[[JCache::clean/11.1|clean]] | ||
|Clean cache for a group given a mode. | |Clean cache for a group given a mode. | ||
|- | |- | ||
| + | |public | ||
|[[JCache::gc/11.1|gc]] | |[[JCache::gc/11.1|gc]] | ||
|Garbage collect expired cache data. | |Garbage collect expired cache data. | ||
|- | |- | ||
| + | |public | ||
|[[JCache::get/11.1|get]] | |[[JCache::get/11.1|get]] | ||
|Get cached data by id and group. | |Get cached data by id and group. | ||
|- | |- | ||
| + | |public | ||
|[[JCache::getAll/11.1|getAll]] | |[[JCache::getAll/11.1|getAll]] | ||
|Get a list of all cached data. | |Get a list of all cached data. | ||
|- | |- | ||
| + | |public | ||
|[[JCache::getCaching/11.1|getCaching]] | |[[JCache::getCaching/11.1|getCaching]] | ||
|Get caching state. | |Get caching state. | ||
|- | |- | ||
| + | |public | ||
|[[JCache::lock/11.1|lock]] | |[[JCache::lock/11.1|lock]] | ||
|Set lock flag on cached item. | |Set lock flag on cached item. | ||
|- | |- | ||
| + | |public | ||
|[[JCache::remove/11.1|remove]] | |[[JCache::remove/11.1|remove]] | ||
|Remove a cached data entry by id and group. | |Remove a cached data entry by id and group. | ||
|- | |- | ||
| + | |public | ||
|[[JCache::setCaching/11.1|setCaching]] | |[[JCache::setCaching/11.1|setCaching]] | ||
|Set caching enabled state. | |Set caching enabled state. | ||
|- | |- | ||
| + | |public | ||
|[[JCache::setLifeTime/11.1|setLifeTime]] | |[[JCache::setLifeTime/11.1|setLifeTime]] | ||
|Set cache lifetime. | |Set cache lifetime. | ||
|- | |- | ||
| + | |public | ||
|[[JCache::store/11.1|store]] | |[[JCache::store/11.1|store]] | ||
|Store the cached data by id and group. | |Store the cached data by id and group. | ||
|- | |- | ||
| + | |public | ||
|[[JCache::unlock/11.1|unlock]] | |[[JCache::unlock/11.1|unlock]] | ||
|Unset lock flag on cached item. | |Unset lock flag on cached item. | ||
|- | |- | ||
| + | |public static | ||
|[[JCache::addIncludePath/11.1|addIncludePath]] | |[[JCache::addIncludePath/11.1|addIncludePath]] | ||
|Add a directory where should search for handlers. | |Add a directory where should search for handlers. | ||
|- | |- | ||
| + | |public static | ||
|[[JCache::getInstance/11.1|getInstance]] | |[[JCache::getInstance/11.1|getInstance]] | ||
|Returns a reference to a cache adapter object, always creating it. | |Returns a reference to a cache adapter object, always creating it. | ||
|- | |- | ||
| + | |public static | ||
|[[JCache::getStores/11.1|getStores]] | |[[JCache::getStores/11.1|getStores]] | ||
|Get the storage handlers. | |Get the storage handlers. | ||
|- | |- | ||
| + | |public static | ||
|[[JCache::getWorkarounds/11.1|getWorkarounds]] | |[[JCache::getWorkarounds/11.1|getWorkarounds]] | ||
|Perform workarounds on retrieved cached data. | |Perform workarounds on retrieved cached data. | ||
|- | |- | ||
| + | |public static | ||
|[[JCache::makeId/11.1|makeId]] | |[[JCache::makeId/11.1|makeId]] | ||
|Create safe id for cached data from url parameters set by plugins and framework. | |Create safe id for cached data from url parameters set by plugins and framework. | ||
|- | |- | ||
| + | |public static | ||
|[[JCache::setWorkarounds/11.1|setWorkarounds]] | |[[JCache::setWorkarounds/11.1|setWorkarounds]] | ||
|Create workarounded data to be cached. | |Create workarounded data to be cached. | ||
|- | |- | ||
|} | |} | ||
| + | * '''Defined in''' libraries/joomla/cache/cache.php | ||
| + | * '''Extends''' [[JObject/11.1|JObject]] | ||
===Importing=== | ===Importing=== | ||
<source lang="php">jimport( 'joomla.cache.cache' );</source> | <source lang="php">jimport( 'joomla.cache.cache' );</source> | ||
===See also=== | ===See also=== | ||
| − | * [[JCache|Other versions of | + | * {{JVer|11.1}} '''JCache source code''' on [[jplatform:cache/cache.php|BitBucket]] |
| + | * {{JVer|11.1}} Subpackage [[Subpackage Cache/11.1|Cache]] | ||
| + | * [[JCache|Other versions of JCache]] | ||
{{SeeAlso:JCache}} | {{SeeAlso:JCache}} | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
<nowiki>[</nowiki>[[SeeAlso:JCache|Edit See Also]]<nowiki>]</nowiki> | <nowiki>[</nowiki>[[SeeAlso:JCache|Edit See Also]]<nowiki>]</nowiki> | ||
</span> | </span> | ||
| − | === | + | ===User contributed notes=== |
<CodeExamplesForm /> | <CodeExamplesForm /> | ||
<dpl> | <dpl> | ||
| Line 91: | Line 110: | ||
category=ClassExample | category=ClassExample | ||
include=* | include=* | ||
| + | namespace=CodeExample | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
| − | <noinclude>[[Category:Platform]][[Category:Platform 11.1]][[Category:JCache]]</noinclude> | + | <noinclude>[[Category:Platform JClasses]][[Category:Platform 11.1]][[Category:JCache]]</noinclude> |
Revision as of 13:30, 29 August 2012
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.
JCache
Description
JCache is an abstract class which defines Joomla's basic caching functionality. The class needs to be extended by a concrete cache handler. The Joomla Framework currently provides the handlers JCacheView, JCachePage, JCacheCallback and JCacheOutput [Edit Descripton]
Methods
| Visibility | Method name | Description |
|---|---|---|
| public | __construct | Constructor. |
| public | _getStorage | Get the cache storage handler. |
| public | clean | Clean cache for a group given a mode. |
| public | gc | Garbage collect expired cache data. |
| public | get | Get cached data by id and group. |
| public | getAll | Get a list of all cached data. |
| public | getCaching | Get caching state. |
| public | lock | Set lock flag on cached item. |
| public | remove | Remove a cached data entry by id and group. |
| public | setCaching | Set caching enabled state. |
| public | setLifeTime | Set cache lifetime. |
| public | store | Store the cached data by id and group. |
| public | unlock | Unset lock flag on cached item. |
| public static | addIncludePath | Add a directory where should search for handlers. |
| public static | getInstance | Returns a reference to a cache adapter object, always creating it. |
| public static | getStores | Get the storage handlers. |
| public static | getWorkarounds | Perform workarounds on retrieved cached data. |
| public static | makeId | Create safe id for cached data from url parameters set by plugins and framework. |
| public static | setWorkarounds | Create workarounded data to be cached. |
- Defined in libraries/joomla/cache/cache.php
- Extends JObject
Importing
jimport( 'joomla.cache.cache' );
See also
-
JCache source code on BitBucket
-
Subpackage Cache
- Other versions of JCache
SeeAlso:JCache [Edit See Also]
User contributed notes
<CodeExamplesForm />
