本文整理匯總了PHP中eZContentCacheManager::nodeList方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZContentCacheManager::nodeList方法的具體用法?PHP eZContentCacheManager::nodeList怎麽用?PHP eZContentCacheManager::nodeList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eZContentCacheManager
的用法示例。
在下文中一共展示了eZContentCacheManager::nodeList方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: clearObjectViewCache
/**
* Clears view caches of nodes, parent nodes and relating nodes
* of content object with $objectID.
* It will use 'viewcache.ini' to determine additional nodes.
*
* @param int $objectID The object ID
* @param int $versionNum The version of the object to use, or true for current version
* @param array $additionalNodeList An array with node IDs to add to clear list, or false for no additional nodes.
*/
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);
}
$nodeList = array_unique($nodeList);
eZDebug::accumulatorStop('node_cleanup_list');
return self::clearNodeViewCacheArray($nodeList);
}
示例2: 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;
}
示例3: 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;
}