本文整理汇总了PHP中eZContentCacheManager::dependencyInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP eZContentCacheManager::dependencyInfo方法的具体用法?PHP eZContentCacheManager::dependencyInfo怎么用?PHP eZContentCacheManager::dependencyInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZContentCacheManager
的用法示例。
在下文中一共展示了eZContentCacheManager::dependencyInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: nodeListForObject
static function nodeListForObject($contentObject, $versionNum, $clearCacheType, &$nodeList, &$handledObjectList)
{
$contentObjectID = $contentObject->attribute('id');
if (isset($handledObjectList[$contentObjectID])) {
$handledObjectList[$contentObjectID] |= $clearCacheType;
} else {
$handledObjectList[$contentObjectID] = $clearCacheType;
}
//self::writeDebugBits( $handledObjectList, self::CLEAR_SIBLINGS_CACHE );
$assignedNodes = $contentObject->assignedNodes();
// determine if $contentObject has dependent objects for which cache should be cleared too.
$objectClassIdentifier = $contentObject->attribute('class_identifier');
$dependentClassInfo = eZContentCacheManager::dependencyInfo($objectClassIdentifier);
if ($dependentClassInfo['clear_cache_type'] === self::CLEAR_NO_CACHE) {
// BC: Allow smart cache clear setting to specify no caching setting
$clearCacheType = self::CLEAR_NO_CACHE;
} else {
if ($dependentClassInfo['clear_cache_exclusive'] === true) {
// use class specific smart cache rules exclusivly
$clearCacheType = $dependentClassInfo['clear_cache_type'];
}
}
if ($clearCacheType === self::CLEAR_NO_CACHE) {
// when recursing we will never have to handle this object again for other cache types
// because types of caches to clear will always be set to none
$handledObjectList[$contentObjectID] = self::CLEAR_ALL_CACHE;
}
if ($clearCacheType & self::CLEAR_NODE_CACHE) {
eZContentCacheManager::appendNodeIDs($assignedNodes, $nodeList);
}
if ($clearCacheType & self::CLEAR_PARENT_CACHE) {
eZContentCacheManager::appendParentNodeIDs($contentObject, $versionNum, $nodeList);
}
if ($clearCacheType & self::CLEAR_RELATING_CACHE) {
eZContentCacheManager::appendRelatingNodeIDs($contentObject, $nodeList);
}
if ($clearCacheType & self::CLEAR_KEYWORD_CACHE) {
$keywordClearLimit = null;
$viewcacheini = eZINI::instance('viewcache.ini');
if (is_numeric($viewcacheini->variable('ViewCacheSettings', 'KeywordNodesCacheClearLimit'))) {
$keywordClearLimit = (int) $viewcacheini->variable('ViewCacheSettings', 'KeywordNodesCacheClearLimit');
}
eZContentCacheManager::appendKeywordNodeIDs($contentObject, $versionNum, $nodeList, $keywordClearLimit);
}
if ($clearCacheType & self::CLEAR_SIBLINGS_CACHE) {
eZContentCacheManager::appendSiblingsNodeIDs($assignedNodes, $nodeList);
}
if ($dependentClassInfo['clear_cache_type'] & self::CLEAR_SIBLINGS_CACHE) {
if (!($clearCacheType & self::CLEAR_SIBLINGS_CACHE)) {
eZContentCacheManager::appendSiblingsNodeIDs($assignedNodes, $nodeList);
$handledObjectList[$contentObjectID] |= self::CLEAR_SIBLINGS_CACHE;
}
// drop 'siblings' bit and process parent nodes.
// since 'sibling' mode is affected to the current object
$dependentClassInfo['clear_cache_type'] &= ~self::CLEAR_SIBLINGS_CACHE;
}
if ($clearCacheType & self::CLEAR_CHILDREN_CACHE) {
eZContentCacheManager::appendChildrenNodeIDs($assignedNodes, $nodeList);
}
if ($dependentClassInfo['clear_cache_type'] & self::CLEAR_CHILDREN_CACHE) {
if (!($clearCacheType & self::CLEAR_CHILDREN_CACHE)) {
eZContentCacheManager::appendChildrenNodeIDs($assignedNodes, $nodeList);
$handledObjectList[$contentObjectID] |= self::CLEAR_CHILDREN_CACHE;
}
// drop 'children' bit and process parent nodes.
// since 'children' mode is affected to the current object
$dependentClassInfo['clear_cache_type'] &= ~self::CLEAR_CHILDREN_CACHE;
}
if (isset($dependentClassInfo['additional_objects'])) {
foreach ($dependentClassInfo['additional_objects'] as $objectID) {
// skip if cache type is already handled for this object
if (isset($handledObjectList[$objectID]) && $handledObjectList[$objectID] & self::CLEAR_NODE_CACHE) {
continue;
}
$object = eZContentObject::fetch($objectID);
if ($object) {
//eZDebug::writeDebug( 'adding additional object ' . $objectID, 'eZContentCacheManager::nodeListForObject() for object ' . $contentObjectID );
eZContentCacheManager::nodeListForObject($object, true, self::CLEAR_NODE_CACHE, $nodeList, $handledObjectList);
}
}
}
if (isset($dependentClassInfo['dependent_class_identifier'])) {
$maxParents = $dependentClassInfo['max_parents'];
$dependentClassIdentifiers = $dependentClassInfo['dependent_class_identifier'];
$smartClearType = $dependentClassInfo['clear_cache_type'];
// getting 'path_string's for all locations.
$nodePathList = eZContentCacheManager::fetchNodePathString($assignedNodes);
foreach ($nodePathList as $nodePath) {
$step = 0;
// getting class identifier and node ID for each node in the $nodePath, up to $maxParents
$nodeInfoList = eZContentObjectTreeNode::fetchClassIdentifierListByPathString($nodePath, false, $maxParents);
// for each node in $nodeInfoList determine if this node belongs to $dependentClassIdentifiers. If
// so then clear cache for this node.
foreach ($nodeInfoList as $item) {
if (in_array($item['class_identifier'], $dependentClassIdentifiers)) {
$object = eZContentObject::fetchByNodeID($item['node_id']);
if (!$object instanceof eZContentObject) {
continue;
}
$objectID = $object->attribute('id');
//.........这里部分代码省略.........