kernel/classes/ezcache.php
File containing the {@link eZCache} class
- Copyright
- Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.
- License
- eZ Business Use License Agreement Version 2.0
- Package
- kernel
- Version
- 4.6.0
Functions

eZCacheClearClassID(
$cacheItem
)
:
void
Helper function for eZCache::clearClassID.
Static functions in classes cannot be used as callback functions in PHP 4, that is why we need this helper.
Name | Type | Description |
---|---|---|
$cacheItem |
- Deprecated
- Callback to static class function is now done directly.

eZCacheClearContentTreeMenu(
$cacheItem
)
:
void
Helper function for eZCache::clearContentTreeMenu.
Static functions in classes cannot be used as callback functions in PHP 4, that is why we need this helper.
Name | Type | Description |
---|---|---|
$cacheItem |
- Deprecated
- Callback to static class function is now done directly.

eZCacheClearGlobalINI(
$cacheItem
)
:
void
Helper function for eZCache::clearGlobalINICache.
Static functions in classes cannot be used as callback functions in PHP 4, that is why we need this helper.
Name | Type | Description |
---|---|---|
$cacheItem |
- Deprecated
- Callback to static class function is now done directly.

eZCacheClearImageAlias(
$cacheItem
)
:
void
Helper function for eZCache::clearImageAlias.
Static functions in classes cannot be used as callback functions in PHP 4, that is why we need this helper.
Name | Type | Description |
---|---|---|
$cacheItem |
- Deprecated
- Callback to static class function is now done directly.

eZCacheClearSortKey(
$cacheItem
)
:
void
Helper function for eZCache::clearSortKey.
Static functions in classes cannot be used as callback functions in PHP 4, that is why we need this helper.
Name | Type | Description |
---|---|---|
$cacheItem |
- Deprecated
- Callback to static class function is now done directly.

eZCacheClearTemplateBlockCache(
$cacheItem
)
:
void
Helper function for eZCache::clearTemplateBlockCache.
Static functions in classes cannot be used as callback functions in PHP 4, that is why we need this helper.
Name | Type | Description |
---|---|---|
$cacheItem |
- Deprecated
- Callback to static class function is now done directly.
\eZCache
eZCache ezcache.php
Main class for dealing with caches in eZ Publish.
Has methods for clearing the various caches according to tag, id or all caches. It also has information for all the caches.
Methods


clearActiveExtensions(
$cacheItem
)
:
void
Clears active extensions list cache
Name | Type | Description |
---|---|---|
$cacheItem |


clearAll(
bool $cacheList
=
false
)
:
bool
Clears all cache items.
Name | Type | Description |
---|---|---|
$cacheList | bool |
Type | Description |
---|---|
bool | True |


clearByID(
array $idList, bool | array $cacheList
=
false
)
:
void
Finds all cache item which has ID equal to one of the IDs in $idList.
You can also submit a single id to $idList.
Name | Type | Description |
---|---|---|
$idList | array | The cache ID list |
$cacheList | bool | array | The list of caches, default false |


clearByTag(
string $tagName, bool | array $cacheList
=
false
)
:
void
Finds all cache item which has the tag \a $tagName and clears them.
Name | Type | Description |
---|---|---|
$tagName | string | The tag name |
$cacheList | bool | array | The list of caches, default false |


clearClassID(
$cacheItem
)
:
void
Clears all content class identifier cache files from var/cache.
Name | Type | Description |
---|---|---|
$cacheItem |


clearContentCache(
$cacheItem
)
:
void
Clears all content caches by setting a new expiry value for the key *content-view-cache*.
Name | Type | Description |
---|---|---|
$cacheItem |


clearContentTreeMenu(
$cacheItem
)
:
void
Sets the content tree menu timestamp to the current date and time, this is used as a GET parameter in the content/treemenu requests and thus forces a browser to load the content tree menu from a server rather than to use a cached copy.
Name | Type | Description |
---|---|---|
$cacheItem |


clearDesignBaseCache(
\$cacheItem $cacheItem
)
:
void
Clears the design base cache
Name | Type | Description |
---|---|---|
$cacheItem | \$cacheItem | array the cache item that describes the cache tag/id |


clearGlobalINICache(
$cacheItem
)
:
void
Clear global ini cache
Name | Type | Description |
---|---|---|
$cacheItem |


clearImageAlias(
$cacheItem
)
:
void
Sets the image alias timestamp to the current timestamp, this causes all image aliases to be recreated on viewing.
Name | Type | Description |
---|---|---|
$cacheItem |


clearItem(
\$cacheItem $cacheItem, \$purge $purge
=
false, \$reporter $reporter
=
false, \$iterationSleep $iterationSleep
=
false, \$iterationMax $iterationMax
=
false, \$expiry $expiry
=
false
)
:
void
Clears or purges the cache item $cacheItem.
If $purge is true then the system will ensure the entries are removed from local storage or database backend, otherwise it will use possible optimizations which might only invalidate the cache entry directly or use global expiry values.
Name | Type | Description |
---|---|---|
$cacheItem | \$cacheItem | Cache item array taken from fetchList() |
$purge | \$purge | Controls whether clearing/invalidation or purge is used. |
$reporter | \$reporter | Callback which is called when the system has purged files from the system, called with filename and purge count as parameters. |
$iterationSleep | \$iterationSleep | The amount of microseconds to sleep between each purge iteration, false means no sleep. |
$iterationMax | \$iterationMax | The maximum number of items to purge in one iteration, false means use default limit. |
$expiry | \$expiry | A timestamp which is matched against all cache items, if the modification of the cache is older than the expiry the cache is purged, false means no expiry checking. |


clearSortKey(
$cacheItem
)
:
void
Clears all datatype sortkey cache files from var/cache.
Name | Type | Description |
---|---|---|
$cacheItem |


clearStateLimitations(
$cacheItem
)
:
void
Clears all state limitation cache files.
Name | Type | Description |
---|---|---|
$cacheItem |


clearTSTranslationCache(
array $cacheItem
)
:
void
Clears the .ts translation cache
Name | Type | Description |
---|---|---|
$cacheItem | array |


clearTemplateBlockCache(
$cacheItem
)
:
void
Removes all template block cache files and subtree entries.
Name | Type | Description |
---|---|---|
$cacheItem |


clearTemplateOverrideCache(
$cacheItem
)
:
void
Removes all template override cache files, subtree entries and clears in memory override cache.
Name | Type | Description |
---|---|---|
$cacheItem |
- Since
- 4.2


clearTextToImageCache(
$cacheItem
)
:
void
Clear texttoimage cache
Name | Type | Description |
---|---|---|
$cacheItem |


clearUserInfoCache(
$cacheItem
)
:
void
Clears all user-info caches by setting a new expiry value for the key *user-info-cache*.
Name | Type | Description |
---|---|---|
$cacheItem |


fetchByID(
string $id, array | bool $cacheInfoList
=
false
)
:
array
Finds the first entry with the ID $id.
Name | Type | Description |
---|---|---|
$id | string | The entry id. |
$cacheInfoList | array | bool | The list of cache info per entry |
Type | Description |
---|---|
array | The cache info structure. |


fetchByIDList(
array $idList, array | bool $cacheInfoList
=
false
)
:
array
Finds the entries matching and ID in the list \a $idList.
Name | Type | Description |
---|---|---|
$idList | array | The list of cache ID |
$cacheInfoList | array | bool | The list of cache info per entry |
Type | Description |
---|---|
array | An array with cache info structures. |


fetchByTag(
string $tagName, bool | array $cacheInfoList
=
false
)
:
array
Finds all cache entries using tag $tagName.
Name | Type | Description |
---|---|---|
$tagName | string | The tag name |
$cacheInfoList | bool | array | The list of cache info per entry |
Type | Description |
---|---|
array | An array with cache items. |


fetchIDList(
bool | array $cacheInfoList
=
false
)
:
array
Goes through the cache info list $cacheInfoList and finds all the unique ids.
Name | Type | Description |
---|---|---|
$cacheInfoList | bool | array | If false the list will automatically be fetched, if multiple eZCache functions are called it is a good idea to call fetchList() yourself and pass it as a parameter. |
Type | Description |
---|---|
array | An array with id strings. |


fetchList(
)
:
array
Return a list of all cache items in the system.
Type | Description |
---|---|
array | The list of cache items |


fetchTagList(
bool | array $cacheInfoList
=
false
)
:
array
Goes through the cache info list $cacheInfoList and finds all the unique tags.
Name | Type | Description |
---|---|---|
$cacheInfoList | bool | array | If false the list will automatically be fetched, if multiple eZCache functions are called it is a good idea to call fetchList() yourself and pass it as a parameter. |
Type | Description |
---|---|
array | An array with tag strings. |


purgeImageAlias(
array $cacheItem
)
:
void
Purges the image aliases of all ezimage attribute. The original image is kept.
Name | Type | Description |
---|---|---|
$cacheItem | array |
- Access
- public


purgeImageAliasForObject(
array $cacheItem, \eZContentObject $object, array $imageIdentfiers
)
:
void
The purge the image aliases in all versions of the content object.
Name | Type | Description |
---|---|---|
$cacheItem | array | |
$object | \eZContentObject | |
$imageIdentfiers | array | array of ezimage attribute identifiers |