Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Static Public Member Functions | Public Attributes | Static Private Member Functions | Static Private Attributes | List of all members
eZContentCacheManager Class Reference

Figures out relations between objects, nodes and classes for cache management. More...

## Static Public Member Functions
static | addAdditionalNodeIDPerObject ( $contentObjectID, $additionalNodeID)
static | appendParentNodeIDs ( $object, $versionNum, &$nodeIDList)
static | appendNodeIDs ( $nodeList, &$nodeIDList)
static | fetchNodePathString ( $nodeList)
static | appendRelatingNodeIDs ( $object, &$nodeIDList)
static | appendKeywordNodeIDs ( $object, $versionNum, &$nodeIDList, $limit=null)
static | appendSiblingsNodeIDs (&$nodeList, &$nodeIDList)
static | appendChildrenNodeIDs (&$nodeList, &$nodeIDList)
static | dependencyInfo ( $classID, $ignoreINISettings=false)
static | writeDebugBits ( $handledObjectList, $highestBit)
static | nodeListForObject ( $contentObject, $versionNum, $clearCacheType, &$nodeList, &$handledObjectList)
static | nodeList ( $objectID, $versionNum)
static | clearObjectViewCache ( $objectID, $versionNum=true, $additionalNodeList=false)
static | clearObjectViewCacheArray (array $objectIDList)
static | clearNodeViewCacheArray (array $nodeList, array|null $contentObjectList=null)
static | clearObjectViewCacheIfNeeded ( $objectID, $versionNum=true, $additionalNodeList=false)
static | clearTemplateBlockCacheIfNeeded ( $objectID)
static | clearTemplateBlockCache ( $objectID, $checkViewCacheClassSettings=false)
static | generateObjectViewCache ( $objectID)
static | clearContentCacheIfNeededBySectionID ( $sectionID)
static | clearContentCacheIfNeeded ( $objectID, $versionNum=true, $additionalNodeList=false)
static | clearContentCache ( $objectID, $versionNum=true, $additionalNodeList=false)
static | clearAllContentCache ( $ignoreINISettings=false)

## Public Attributes
const | CLEAR_NO_CACHE = 0
const | CLEAR_NODE_CACHE = 1
const | CLEAR_PARENT_CACHE = 2
const | CLEAR_RELATING_CACHE = 4
const | CLEAR_KEYWORD_CACHE = 8
const | CLEAR_SIBLINGS_CACHE = 16
const | CLEAR_CHILDREN_CACHE = 32
const | CLEAR_ALL_CACHE = 63
const | CLEAR_DEFAULT = 15

## Static Private Member Functions
static | appendAdditionalNodeIDs (eZContentObject $contentObject, &$nodeIDList)

## Static Private Attributes
static | $additionalNodeIDsPerObject = array()

## Detailed Description

Figures out relations between objects, nodes and classes for cache management.

This class works together with eZContentCache to manage the cache files for content viewing. This class takes care of finding out the relationship and then passes a list of nodes to eZContentCache which does the actual clearing.

The manager uses special rules in 'viewcache.ini' to figure relationships.

See also
  eZContentCache

Definition at line 24 of file ezcontentcachemanager.php.

## Member Function Documentation

## ◆ addAdditionalNodeIDPerObject()

static eZContentCacheManager::addAdditionalNodeIDPerObject | ( |  | $contentObjectID,
|  |  | $additionalNodeID
| ) |  |
| static

Adds an additional NodeID to be appended to the node list for clearing view cache.

Parameters

  int | $contentObjectID |
  int | $additionalNodeID |

Definition at line 51 of file ezcontentcachemanager.php.

## ◆ appendAdditionalNodeIDs()

static eZContentCacheManager::appendAdditionalNodeIDs | ( | eZContentObject | $contentObject,
|  | & | $nodeIDList
| ) |  |
| static private

Appends additional node IDs.

Parameters

  eZContentObject | $contentObject |
  array | $nodeIDList |

Definition at line 67 of file ezcontentcachemanager.php.

References eZPersistentObject\attribute().

Referenced by nodeListForObject().

## ◆ appendChildrenNodeIDs()

static eZContentCacheManager::appendChildrenNodeIDs | ( | & | $nodeList,
|  | & | $nodeIDList
| ) |  |
| static

For each node in $nodeList finds its children nodes and adds its ids to the $nodeIDList.

Parameters

  array(eZContentObjectTreeNode) | $nodeList
  array(int) | $nodeIDList

Definition at line 307 of file ezcontentcachemanager.php.

References eZContentObjectTreeNode\subTreeByNodeID().

Referenced by nodeListForObject().

## ◆ appendKeywordNodeIDs()

static eZContentCacheManager::appendKeywordNodeIDs | ( |  | $object,
|  |  | $versionNum,
|  | & | $nodeIDList,
|  |  | $limit = `null`
| ) |  |
| static

Appends node ids of objects with the same keyword(s) as $object to $nodeIDList array.

Parameters

  | $versionNum | The version of the object to use or `true` for current version
  [out] | $nodeIDList | Array with node IDs

Definition at line 224 of file ezcontentcachemanager.php.

References eZDB\instance().

Referenced by nodeListForObject().

## ◆ appendNodeIDs()

static eZContentCacheManager::appendNodeIDs | ( |  | $nodeList,
|  | & | $nodeIDList
| ) |  |
| static

Appends nodes ids from $nodeList list to $nodeIDList

Parameters

  [out] | $nodeIDList | Array with node IDs

Definition at line 98 of file ezcontentcachemanager.php.

Referenced by nodeListForObject().

## ◆ appendParentNodeIDs()

static eZContentCacheManager::appendParentNodeIDs | ( |  | $object,
|  |  | $versionNum,
|  | & | $nodeIDList
| ) |  |
| static

Appends parent nodes ids of $object to $nodeIDList array.

Parameters

  | $versionNum | The version of the object to use or `true` for current version
  [out] | $nodeIDList | Array with node IDs

Definition at line 85 of file ezcontentcachemanager.php.

Referenced by nodeListForObject().

## ◆ appendRelatingNodeIDs()

static eZContentCacheManager::appendRelatingNodeIDs | ( |  | $object,
|  | & | $nodeIDList
| ) |  |
| static

Find all content objects that relates $object and appends their node IDs to $nodeIDList.

Parameters

  [out] | $nodeIDList | Array with node IDs

Definition at line 127 of file ezcontentcachemanager.php.

References eZContentObject\RELATION_ATTRIBUTE, eZContentObject\RELATION_COMMON, eZContentObject\RELATION_EMBED, and eZContentObject\RELATION_LINK.

Referenced by nodeListForObject().

## ◆ appendSiblingsNodeIDs()

static eZContentCacheManager::appendSiblingsNodeIDs | ( | & | $nodeList,
|  | & | $nodeIDList
| ) |  |
| static

Definition at line 283 of file ezcontentcachemanager.php.

References eZContentObjectTreeNode\subTreeByNodeID().

Referenced by nodeListForObject().

## ◆ clearAllContentCache()

static eZContentCacheManager::clearAllContentCache | ( |  | $ignoreINISettings = `false` | ) |
| static

Clears all content cache: view cache, template-block cache, template-block with subtree_expiry parameter cache.

Definition at line 1116 of file ezcontentcachemanager.php.

References eZSubtreeCache\cleanupAll(), and eZContentObject\expireAllCache().

Referenced by eZContentLanguage\addLanguage(), eZContentObjectTreeNodeOperations\move(), eZContentLanguage\removeThis(), and eZContentClass\storeVersioned().

## ◆ clearContentCache()

static eZContentCacheManager::clearContentCache | ( |  | $objectID,
|  |  | $versionNum = `true`,
|  |  | $additionalNodeList = `false`
| ) |  |
| static

Clears content cache for specified object: view cache, template-block cache, template-block with subtree_expiry parameter cache without checking of ini settings.

Parameters

  int | array | $objectID | (list of) object ID
  bool | int | $versionNum |
  bool | array | $additionalNodeList |

Definition at line 1084 of file ezcontentcachemanager.php.

References eZDebug\accumulatorStart(), eZDebug\accumulatorStop(), clearObjectViewCache(), clearObjectViewCacheArray(), and clearTemplateBlockCache().

## ◆ clearContentCacheIfNeeded()

static eZContentCacheManager::clearContentCacheIfNeeded | ( |  | $objectID,
|  |  | $versionNum = `true`,
|  |  | $additionalNodeList = `false`
| ) |  |
| static

Clears content cache for specified (list of) object: view cache, template-block cache, template-block with subtree_expiry parameter cache. Checks appropriate ini settings to determine whether caches are enabled or not.

Parameters

  int | array | $objectID | (list of) object ID
  bool | int | $versionNum |
  bool | array | $additionalNodeList |

Definition at line 1062 of file ezcontentcachemanager.php.

References eZDebug\accumulatorStart(), eZDebug\accumulatorStop(), clearObjectViewCacheIfNeeded(), and clearTemplateBlockCacheIfNeeded().

Referenced by eZSection\applyTo(), eZURLObjectLink\clearCacheForObjectLink(), clearContentCacheIfNeededBySectionID(), eZContentObjectTreeNode\clearViewCacheForSubtree(), eZContentObjectTreeNodeOperations\move(), eZContentObjectOperations\remove(), eZContentObjectTreeNode\removeThis(), eZUser\setFailedLoginAttempts(), and eZSiteInstaller\swapNodes().

## ◆ clearContentCacheIfNeededBySectionID()

static eZContentCacheManager::clearContentCacheIfNeededBySectionID | ( |  | $sectionID | ) |
| static

Clears content cache if needed by $sectionID

Definition at line 1040 of file ezcontentcachemanager.php.

References clearContentCacheIfNeeded(), and eZContentObject\fetchList().

## ◆ clearNodeViewCacheArray()

static eZContentCacheManager::clearNodeViewCacheArray | ( | array | $nodeList,
|  | array|null | $contentObjectList = `null`
| ) |  |
| static

Clears view caches for an array of nodes.

Parameters

  array | $nodeList | List of node IDs to clear
  array | null | $contentObjectList | List of content object IDs to clear

Returns
  boolean returns true on success

Definition at line 741 of file ezcontentcachemanager.php.

References eZDebug\accumulatorStart(), eZDebug\accumulatorStop(), eZContentCache\calculateCleanupValue(), eZContentCache\cleanup(), eZContentObject\expireAllViewCache(), eZContentObject\expireComplexViewModeCache(), eZExtension\getHandlerClass(), eZContentCache\inCleanupThresholdRange(), eZDebugSetting\writeDebug(), and eZDebug\writeDebug().

Referenced by clearObjectViewCache(), and clearObjectViewCacheArray().

## ◆ clearObjectViewCache()

static eZContentCacheManager::clearObjectViewCache | ( |  | $objectID,
|  |  | $versionNum = `true`,
|  |  | $additionalNodeList = `false`
| ) |  |
| static

Clears view caches of nodes, parent nodes and relating nodes of content object with $objectID. It will use 'viewcache.ini' to determine additional nodes.

Parameters

  int | $objectID | The object ID
  int | $versionNum | The version of the object to use, or true for current version
  array | $additionalNodeList | An array with node IDs to add to clear list, or false for no additional nodes.

Definition at line 676 of file ezcontentcachemanager.php.

References eZDebug\accumulatorStart(), eZDebug\accumulatorStop(), clearNodeViewCacheArray(), and nodeList().

Referenced by clearContentCache(), clearObjectViewCacheIfNeeded(), and eZLDAPUser\publishUpdateUser().

## ◆ clearObjectViewCacheArray()

static eZContentCacheManager::clearObjectViewCacheArray | ( | array | $objectIDList | ) |
| static

Clears view caches of nodes, parent nodes and relating nodes of content objects with ids contained in $objectIDList. It will use 'viewcache.ini' to determine additional nodes.

See also
  clearObjectViewCache

Parameters

  array | $objectIDList | List of object ID

Definition at line 711 of file ezcontentcachemanager.php.

References eZDebug\accumulatorStart(), eZDebug\accumulatorStop(), clearNodeViewCacheArray(), and nodeList().

Referenced by eZSection\applyTo(), clearContentCache(), clearObjectViewCacheIfNeeded(), and eZContentObject\fixReverseRelations().

## ◆ clearObjectViewCacheIfNeeded()

static eZContentCacheManager::clearObjectViewCacheIfNeeded | ( |  | $objectID,
|  |  | $versionNum = `true`,
|  |  | $additionalNodeList = `false`
| ) |  |
| static

Clears view cache for specified object(s). Checks 'ViewCaching' ini setting to determine whether cache is enabled or not.

Parameters

  array | $objectID | (list of) object ID
  bool | int | $versionNum |
  bool | array | $additionalNodeList |

Definition at line 795 of file ezcontentcachemanager.php.

References clearObjectViewCache(), and clearObjectViewCacheArray().

Referenced by clearContentCacheIfNeeded().

## ◆ clearTemplateBlockCache()

static eZContentCacheManager::clearTemplateBlockCache | ( |  | $objectID,
|  |  | $checkViewCacheClassSettings = `false`
| ) |  |
| static

Clears template-block cache and template-block with subtree_expiry parameter caches for specified object without checking 'TemplateCache' ini setting.

Parameters

  int | array | bool | $objectID | (list of) object ID, if false only ordinary template block caches will be cleared Support for array value available {

Since
  5.0}.

Parameters

  bool | $checkViewCacheClassSettings | Check whether ViewCache class settings should be verified

Definition at line 838 of file ezcontentcachemanager.php.

References eZSubtreeCache\cleanup(), eZContentObject\expireTemplateBlockCache(), eZContentObject\fetch(), and eZContentObject\fetchIDArray().

Referenced by clearContentCache(), and clearTemplateBlockCacheIfNeeded().

## ◆ clearTemplateBlockCacheIfNeeded()

static eZContentCacheManager::clearTemplateBlockCacheIfNeeded | ( |  | $objectID | ) |
| static

Clears template-block cache and template-block with subtree_expiry parameter caches for specified object(s). Checks 'TemplateCache' ini setting to determine whether cache is enabled or not. If $objectID is `false` all template block caches will be cleared.

Parameters

  int | array | $objectID | (list of) object ID.

Definition at line 823 of file ezcontentcachemanager.php.

References clearTemplateBlockCache().

Referenced by clearContentCacheIfNeeded(), and eZPackageType\storeObjectAttribute().

## ◆ dependencyInfo()

static eZContentCacheManager::dependencyInfo | ( |  | $classID,
|  |  | $ignoreINISettings = `false`
| ) |  |
| static

Definition at line 336 of file ezcontentcachemanager.php.

References CLEAR_ALL_CACHE, CLEAR_CHILDREN_CACHE, CLEAR_DEFAULT, CLEAR_KEYWORD_CACHE, CLEAR_NO_CACHE, CLEAR_NODE_CACHE, CLEAR_PARENT_CACHE, CLEAR_RELATING_CACHE, and CLEAR_SIBLINGS_CACHE.

Referenced by nodeListForObject().

## ◆ fetchNodePathString()

static eZContentCacheManager::fetchNodePathString | ( |  | $nodeList | ) |
| static

Goes through all content nodes in $nodeList and extracts the `'path_string'`.

Returns
  An array with `'path_string'` information.

Definition at line 111 of file ezcontentcachemanager.php.

Referenced by nodeListForObject().

## ◆ generateObjectViewCache()

static eZContentCacheManager::generateObjectViewCache | ( |  | $objectID | ) |
| static

Generates the related viewcaches (PreGeneration) for the content object. It will only do this if [ContentSettings]/PreViewCache in site.ini is enabled.

Parameters

  $objectID | The ID of the content object to generate caches for.

Definition at line 891 of file ezcontentcachemanager.php.

References eZDebug\accumulatorStart(), eZDebug\accumulatorStop(), eZUser\currentUser(), eZTemplate\factory(), eZUser\fetch(), eZContentObject\fetch(), eZContentObjectTreeNode\fetch(), eZNodeviewfunctions\generateNodeView(), eZNodeviewfunctions\generateViewCacheFile(), eZExtension\getHandlerClass(), eZSiteAccess\load(), eZUser\NO_SESSION_REGENERATE, nodeListForObject(), and eZUser\setCurrentlyLoggedInUser().

Referenced by eZUser\setFailedLoginAttempts().

## ◆ nodeList()

static eZContentCacheManager::nodeList | ( |  | $objectID,
|  |  | $versionNum
| ) |  |
| static

Figures out all nodes that are affected by the change of object $objectID. This involves finding all nodes, parent nodes and nodes of objects that relate this object. The 'viewcache.ini' file is also checked to see if some special content classes has dependencies to the current object, if this is true extra nodes might be included.

Parameters

  $versionNum | The version of the object to use or `true` for current version
  $additionalNodeList | An array with node IDs to add to clear list, or `false` for no additional nodes.

Returns
  An array with node IDs that must have their viewcaches cleared.

Definition at line 652 of file ezcontentcachemanager.php.

References eZContentObject\fetch(), and nodeListForObject().

Referenced by clearObjectViewCache(), and clearObjectViewCacheArray().

## ◆ nodeListForObject()

static eZContentCacheManager::nodeListForObject | ( |  | $contentObject,
|  |  | $versionNum,
|  |  | $clearCacheType,
|  | & | $nodeList,
|  | & | $handledObjectList
| ) |  |
| static

Use $clearCacheType to include different kind of nodes( parent, relating, etc ). If $versionNum is true, then current version will be used.

Parameters

  | $contentObject | Current content object that is checked.
  | $versionNum | The version of the object to use or `true` for current version
  | $clearCacheType | Bit field which controls the the extra nodes to include, use bitwise or with one of these defines: self::CLEAR_NODE_CACHE - Clear the nodes of the object self::CLEAR_PARENT_CACHE - Clear the parent nodes of the object self::CLEAR_RELATING_CACHE - Clear nodes of objects that relate this object self::CLEAR_KEYWORD_CACHE - Clear nodes of objects that have the same keyword as this object self::CLEAR_SIBLINGS_CACHE - Clear caches for siblings of the node. self::CLEAR_ALL_CACHE - Enables all of the above self::CLEAR_NO_CACHE - Do not clear cache for current object.
  [out] | $nodeList | An array with node IDs that are affected by the current object change.
  [out] | $handledObjectList | An associative array with object IDs and the cache types that were handled for these objects already. Used to avoid infinite recursion.

Note
  This function is recursive.

Definition at line 457 of file ezcontentcachemanager.php.

References appendAdditionalNodeIDs(), appendChildrenNodeIDs(), appendKeywordNodeIDs(), appendNodeIDs(), appendParentNodeIDs(), appendRelatingNodeIDs(), appendSiblingsNodeIDs(), CLEAR_ALL_CACHE, CLEAR_CHILDREN_CACHE, CLEAR_NO_CACHE, CLEAR_SIBLINGS_CACHE, dependencyInfo(), eZContentObject\fetch(), eZContentObject\fetchByNodeID(), eZContentObjectTreeNode\fetchClassIdentifierListByPathString(), and fetchNodePathString().

Referenced by generateObjectViewCache(), and nodeList().

## ◆ writeDebugBits()

static eZContentCacheManager::writeDebugBits | ( |  | $handledObjectList,
|  |  | $highestBit
| ) |  |
| static

Definition at line 415 of file ezcontentcachemanager.php.

References eZDebug\writeDebug().

## Member Data Documentation

## ◆ $additionalNodeIDsPerObject

eZContentCacheManager::$additionalNodeIDsPerObject = array()
| static private

Definition at line 43 of file ezcontentcachemanager.php.

## ◆ CLEAR_ALL_CACHE

const eZContentCacheManager::CLEAR_ALL_CACHE = 63

Definition at line 34 of file ezcontentcachemanager.php.

Referenced by dependencyInfo(), and nodeListForObject().

## ◆ CLEAR_CHILDREN_CACHE

const eZContentCacheManager::CLEAR_CHILDREN_CACHE = 32

Definition at line 33 of file ezcontentcachemanager.php.

Referenced by dependencyInfo(), and nodeListForObject().

## ◆ CLEAR_DEFAULT

const eZContentCacheManager::CLEAR_DEFAULT = 15

Definition at line 35 of file ezcontentcachemanager.php.

Referenced by dependencyInfo().

## ◆ CLEAR_KEYWORD_CACHE

const eZContentCacheManager::CLEAR_KEYWORD_CACHE = 8

Definition at line 31 of file ezcontentcachemanager.php.

Referenced by dependencyInfo().

## ◆ CLEAR_NO_CACHE

const eZContentCacheManager::CLEAR_NO_CACHE = 0

Definition at line 27 of file ezcontentcachemanager.php.

Referenced by dependencyInfo(), and nodeListForObject().

## ◆ CLEAR_NODE_CACHE

const eZContentCacheManager::CLEAR_NODE_CACHE = 1

Definition at line 28 of file ezcontentcachemanager.php.

Referenced by dependencyInfo().

## ◆ CLEAR_PARENT_CACHE

const eZContentCacheManager::CLEAR_PARENT_CACHE = 2

Definition at line 29 of file ezcontentcachemanager.php.

Referenced by dependencyInfo().

## ◆ CLEAR_RELATING_CACHE

const eZContentCacheManager::CLEAR_RELATING_CACHE = 4

Definition at line 30 of file ezcontentcachemanager.php.

Referenced by dependencyInfo().

## ◆ CLEAR_SIBLINGS_CACHE

const eZContentCacheManager::CLEAR_SIBLINGS_CACHE = 16

Definition at line 32 of file ezcontentcachemanager.php.

Referenced by dependencyInfo(), and nodeListForObject().

The documentation for this class was generated from the following file:

- ezcontentcachemanager.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.