本文整理匯總了PHP中eZContentObject::expireTemplateBlockCache方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZContentObject::expireTemplateBlockCache方法的具體用法?PHP eZContentObject::expireTemplateBlockCache怎麽用?PHP eZContentObject::expireTemplateBlockCache使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eZContentObject
的用法示例。
在下文中一共展示了eZContentObject::expireTemplateBlockCache方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: expireTemplateBlockCacheIfNeeded
static function expireTemplateBlockCacheIfNeeded()
{
$ini = eZINI::instance();
if ( $ini->variable( 'TemplateSettings', 'TemplateCache' ) == 'enabled' )
eZContentObject::expireTemplateBlockCache();
}
示例2: clearTemplateBlockCache
/**
* Clears template-block cache and template-block with subtree_expiry parameter caches for specified object
* without checking 'TemplateCache' ini setting.
*
* @param 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}.
* @param bool $checkViewCacheClassSettings Check whether ViewCache class settings should be verified
*/
public static function clearTemplateBlockCache($objectID, $checkViewCacheClassSettings = false)
{
// ordinary template block cache
eZContentObject::expireTemplateBlockCache();
if (empty($objectID)) {
return;
}
// subtree template block cache
$nodeList = false;
if (is_array($objectID)) {
$objects = eZContentObject::fetchIDArray($objectID);
} else {
$objects = array($objectID => eZContentObject::fetch($objectID));
}
$ini = eZINI::instance('viewcache.ini');
foreach ($objects as $object) {
if ($object instanceof eZContentObject) {
$getAssignedNodes = true;
if ($checkViewCacheClassSettings) {
$objectClassIdentifier = $object->attribute('class_identifier');
if ($ini->hasVariable($objectClassIdentifier, 'ClearCacheBlocks') && $ini->variable($objectClassIdentifier, 'ClearCacheBlocks') === 'disabled') {
$getAssignedNodes = false;
}
}
if ($getAssignedNodes) {
$nodeList = array_merge($nodeList !== false ? $nodeList : array(), $object->assignedNodes());
}
}
}
eZSubtreeCache::cleanup($nodeList);
}
示例3: clearTemplateBlockCache
static function clearTemplateBlockCache($objectID, $checkViewCacheClassSettings = false)
{
// ordinary template block cache
eZContentObject::expireTemplateBlockCache();
// subtree template block cache
$nodeList = false;
$object = false;
if ($objectID) {
$object = eZContentObject::fetch($objectID);
}
if ($object instanceof eZContentObject) {
$getAssignedNodes = true;
if ($checkViewCacheClassSettings) {
$ini = eZINI::instance('viewcache.ini');
$objectClassIdentifier = $object->attribute('class_identifier');
if ($ini->hasVariable($objectClassIdentifier, 'ClearCacheBlocks') && $ini->variable($objectClassIdentifier, 'ClearCacheBlocks') === 'disabled') {
$getAssignedNodes = false;
}
}
if ($getAssignedNodes) {
$nodeList = $object->assignedNodes();
}
}
eZSubtreeCache::cleanup($nodeList);
}