本文整理汇总了PHP中eZContentObject::expireAllViewCache方法的典型用法代码示例。如果您正苦于以下问题:PHP eZContentObject::expireAllViewCache方法的具体用法?PHP eZContentObject::expireAllViewCache怎么用?PHP eZContentObject::expireAllViewCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZContentObject
的用法示例。
在下文中一共展示了eZContentObject::expireAllViewCache方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: remove
static function remove($objectID, $removeSubtrees = true)
{
eZContentCacheManager::clearContentCacheIfNeeded($objectID);
$object = eZContentObject::fetch($objectID);
if (!is_object($object)) {
return false;
}
// TODO: Is content cache cleared for all objects in subtree ??
if ($removeSubtrees) {
$assignedNodes = $object->attribute('assigned_nodes');
if (count($assignedNodes) == 0) {
$object->purge();
eZContentObject::expireAllViewCache();
return true;
}
$assignedNodeIDArray = array();
foreach ($assignedNodes as $node) {
$assignedNodeIDArray[] = $node->attribute('node_id');
}
eZContentObjectTreeNode::removeSubtrees($assignedNodeIDArray, false);
} else {
$object->purge();
}
return true;
}
示例2: remove
static function remove($classID)
{
$contentClass = eZContentClass::fetch($classID);
if ($contentClass == null or !$contentClass->isRemovable()) {
return false;
}
// Remove all objects
$contentObjects = eZContentObject::fetchSameClassList($classID);
foreach ($contentObjects as $contentObject) {
eZContentObjectOperations::remove($contentObject->attribute('id'));
}
if (count($contentObjects) == 0) {
eZContentObject::expireAllViewCache();
}
eZContentClassClassGroup::removeClassMembers($classID, 0);
eZContentClassClassGroup::removeClassMembers($classID, 1);
// Fetch real version and remove it
$contentClass->remove(true);
// Fetch temp version and remove it
$tempDeleteClass = eZContentClass::fetch($classID, true, 1);
if ($tempDeleteClass != null) {
$tempDeleteClass->remove(true, 1);
}
return true;
}
示例3: clearObjectViewCacheArray
/**
* 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 clearObjectViewCache
*
* @param array $objectIDList List of object ID
*/
public static function clearObjectViewCacheArray(array $objectIDList)
{
eZDebug::accumulatorStart('node_cleanup_list', '', 'Node cleanup list');
$nodeList = array();
foreach ($objectIDList as $objectID) {
$tempNodeList = self::nodeList($objectID, true);
if ($tempNodeList !== false) {
$nodeList = array_merge($nodeList, $tempNodeList);
}
}
$nodeList = array_unique($nodeList);
eZDebug::accumulatorStop('node_cleanup_list');
eZDebugSetting::writeDebug('kernel-content-edit', count($nodeList), "count in nodeList");
if (eZINI::instance()->variable('ContentSettings', 'StaticCache') === 'enabled') {
$staticCacheHandler = eZExtension::getHandlerClass(new ezpExtensionOptions(array('iniFile' => 'site.ini', 'iniSection' => 'ContentSettings', 'iniVariable' => 'StaticCacheHandler')));
$staticCacheHandler->generateAlwaysUpdatedCache();
$staticCacheHandler->generateNodeListCache($nodeList);
}
eZDebug::accumulatorStart('node_cleanup', '', 'Node cleanup');
$nodeList = ezpEvent::getInstance()->filter('content/cache', $nodeList);
eZContentObject::expireComplexViewModeCache();
$cleanupValue = eZContentCache::calculateCleanupValue(count($nodeList));
if (eZContentCache::inCleanupThresholdRange($cleanupValue)) {
eZContentCache::cleanup($nodeList);
} else {
eZDebug::writeDebug("Expiring all view cache since list of nodes({$cleanupValue}) exceeds site.ini\\[ContentSettings]\\CacheThreshold", __METHOD__);
eZContentObject::expireAllViewCache();
}
eZDebug::accumulatorStop('node_cleanup');
return true;
}
示例4: clearObjectViewCache
static function clearObjectViewCache($objectID, $versionNum = true, $additionalNodeList = false)
{
eZDebug::accumulatorStart('node_cleanup_list', '', 'Node cleanup list');
$nodeList = eZContentCacheManager::nodeList($objectID, $versionNum);
if ($nodeList === false and !is_array($additionalNodeList)) {
return false;
}
if ($nodeList === false) {
$nodeList = array();
}
if (is_array($additionalNodeList)) {
array_splice($nodeList, count($nodeList), 0, $additionalNodeList);
}
if (count($nodeList) == 0) {
return false;
}
$nodeList = array_unique($nodeList);
eZDebug::accumulatorStop('node_cleanup_list');
eZDebugSetting::writeDebug('kernel-content-edit', count($nodeList), "count in nodeList");
$ini = eZINI::instance();
if ($ini->variable('ContentSettings', 'StaticCache') == 'enabled') {
$optionArray = array('iniFile' => 'site.ini', 'iniSection' => 'ContentSettings', 'iniVariable' => 'StaticCacheHandler');
$options = new ezpExtensionOptions($optionArray);
$staticCacheHandler = eZExtension::getHandlerClass($options);
$staticCacheHandler->generateAlwaysUpdatedCache();
$staticCacheHandler->generateNodeListCache($nodeList);
}
eZDebug::accumulatorStart('node_cleanup', '', 'Node cleanup');
$nodeList = ezpEvent::getInstance()->filter('content/cache', $nodeList);
eZContentObject::expireComplexViewModeCache();
$cleanupValue = eZContentCache::calculateCleanupValue(count($nodeList));
if (eZContentCache::inCleanupThresholdRange($cleanupValue)) {
eZContentCache::cleanup($nodeList);
} else {
eZDebug::writeDebug("Expiring all view cache since list of nodes({$cleanupValue}) related to object({$objectID}) exeeds site.ini\\[ContentSettings]\\CacheThreshold", __METHOD__);
eZContentObject::expireAllViewCache();
}
eZDebug::accumulatorStop('node_cleanup');
return true;
}
示例5: clearObjectViewCache
static function clearObjectViewCache( $objectIDList, $versionNum = true, $additionalNodeList = false )
{
eZDebug::accumulatorStart( 'node_cleanup_list', '', 'Node cleanup list' );
$nodeList = array();
foreach ($objectIDList as $objectID)
{
$tmp = eZContentCacheManager::nodeList( $objectID, $versionNum );
if (is_array($tmp) )
{
$nodeList = array_merge($nodeList, $tmp);
}
}
if ( $nodeList === false and !is_array( $additionalNodeList ) )
{
return false;
}
if ( $nodeList === false )
{
$nodeList = array();
}
if ( is_array( $additionalNodeList ) )
{
array_splice( $nodeList, count( $nodeList ), 0, $additionalNodeList );
}
if ( count( $nodeList ) == 0 )
{
return false;
}
$nodeList = array_unique( $nodeList );
eZDebug::accumulatorStop( 'node_cleanup_list' );
eZDebugSetting::writeDebug( 'kernel-content-edit', count( $nodeList ), "count in nodeList" );
$ini = eZINI::instance();
if ( $ini->variable( 'ContentSettings', 'StaticCache' ) == 'enabled' )
{
$staticCache = new eZStaticCache();
$staticCache->generateAlwaysUpdatedCache();
$staticCache->generateNodeListCache( $nodeList );
}
eZDebug::accumulatorStart( 'node_cleanup', '', 'Node cleanup' );
eZContentObject::expireComplexViewModeCache();
$cleanupValue = eZContentCache::calculateCleanupValue( count( $nodeList ) );
if ( eZContentCache::inCleanupThresholdRange( $cleanupValue ) )
{
eZContentCache::cleanup( $nodeList );
}
else
{
eZContentObject::expireAllViewCache();
}
eZDebug::accumulatorStop( 'node_cleanup' );
return true;
}