eZPublishCommunityProject(LegacyStack)  2013.5
eZContentCacheManager Class Reference

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

Static Public Member Functions

static appendChildrenNodeIDs (&$nodeList, &$nodeIDList)
 For each node in $nodeList finds its children nodes and adds its ids to the $nodeIDList. More...
 
static appendKeywordNodeIDs ($object, $versionNum, &$nodeIDList, $limit=null)
 
static appendNodeIDs ($nodeList, &$nodeIDList)
 
static appendParentNodeIDs ($object, $versionNum, &$nodeIDList)
 
static appendRelatingNodeIDs ($object, &$nodeIDList)
 
static appendSiblingsNodeIDs (&$nodeList, &$nodeIDList)
 
static clearAllContentCache ($ignoreINISettings=false)
 
static clearContentCache ($objectID, $versionNum=true, $additionalNodeList=false)
 Clears content cache for specified object: view cache, template-block cache, template-block with subtree_expiry parameter cache without checking of ini settings. More...
 
static clearContentCacheIfNeeded ($objectID, $versionNum=true, $additionalNodeList=false)
 Clears content cache for specified (list of) object: view cache, template-block cache, template-block with subtree_expiry parameter cache. More...
 
static clearContentCacheIfNeededBySectionID ($sectionID)
 
static clearObjectViewCache ($objectID, $versionNum=true, $additionalNodeList=false)
 
static clearObjectViewCacheArray (array $objectIDList)
 Clears view caches of nodes, parent nodes and relating nodes of content objects with ids contained in $objectIDList. More...
 
static clearObjectViewCacheIfNeeded ($objectID, $versionNum=true, $additionalNodeList=false)
 Clears view cache for specified object(s). More...
 
static clearTemplateBlockCache ($objectID, $checkViewCacheClassSettings=false)
 Clears template-block cache and template-block with subtree_expiry parameter caches for specified object without checking 'TemplateCache' ini setting. More...
 
static clearTemplateBlockCacheIfNeeded ($objectID)
 Clears template-block cache and template-block with subtree_expiry parameter caches for specified object(s). More...
 
static dependencyInfo ($classID, $ignoreINISettings=false)
 
static fetchNodePathString ($nodeList)
 
static generateObjectViewCache ($objectID)
 
static nodeList ($objectID, $versionNum)
 
static nodeListForObject ($contentObject, $versionNum, $clearCacheType, &$nodeList, &$handledObjectList)
 
static writeDebugBits ($handledObjectList, $highestBit)
 

Public Attributes

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

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

Member Function Documentation

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

Referenced by nodeListForObject().

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
$versionNumThe version of the object to use or true for current version
[out]$nodeIDListArray with node IDs

Referenced by nodeListForObject().

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

Appends nodes ids from $nodeList list to $nodeIDList

Parameters
[out]$nodeIDListArray with node IDs

Referenced by nodeListForObject().

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

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

Parameters
$versionNumThe version of the object to use or true for current version
[out]$nodeIDListArray with node IDs

Referenced by nodeListForObject().

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

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

Parameters
[out]$nodeIDListArray with node IDs

Referenced by nodeListForObject().

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

Referenced by nodeListForObject().

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

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

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

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

Referenced by eZContentOperationCollection\changeSortOrder().

static eZContentCacheManager::clearContentCacheIfNeededBySectionID (   $sectionID)
static

Clears content cache if needed by $sectionID

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

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

Parameters
$versionNumThe version of the object to use or true for current version
$additionalNodeListAn array with node IDs to add to clear list, or false for no additional nodes.

Referenced by eZLDAPUser\publishUpdateUser().

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$objectIDListList of object ID

Referenced by eZContentObject\fixReverseRelations().

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

Referenced by eZContentOperationCollection\removeNodes().

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$checkViewCacheClassSettingsCheck whether ViewCache class settings should be verified
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.

Referenced by eZPackageType\storeObjectAttribute().

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

Referenced by nodeListForObject().

static eZContentCacheManager::fetchNodePathString (   $nodeList)
static

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

Returns
An array with 'path_string' information.

Referenced by nodeListForObject().

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
$objectIDThe ID of the content object to generate caches for.

Referenced by eZContentOperationCollection\generateObjectViewCache(), eZUser\setFailedLoginAttempts(), and eZUserOperationCollection\setSettings().

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
$versionNumThe version of the object to use or true for current version
$additionalNodeListAn 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.

Referenced by clearObjectViewCache().

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
$contentObjectCurrent content object that is checked.
$versionNumThe version of the object to use or true for current version
$clearCacheTypeBit 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]$nodeListAn array with node IDs that are affected by the current object change.
[out]$handledObjectListAn 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.

Referenced by generateObjectViewCache(), and nodeList().

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

Member Data Documentation

const eZContentCacheManager::CLEAR_ALL_CACHE = 63
const eZContentCacheManager::CLEAR_CHILDREN_CACHE = 32

Referenced by nodeListForObject().

const eZContentCacheManager::CLEAR_DEFAULT = 15
const eZContentCacheManager::CLEAR_KEYWORD_CACHE = 8
const eZContentCacheManager::CLEAR_NO_CACHE = 0
const eZContentCacheManager::CLEAR_NODE_CACHE = 1
const eZContentCacheManager::CLEAR_PARENT_CACHE = 2
const eZContentCacheManager::CLEAR_RELATING_CACHE = 4
const eZContentCacheManager::CLEAR_SIBLINGS_CACHE = 16

Referenced by nodeListForObject().


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