本文整理汇总了PHP中eZSection::setGlobalID方法的典型用法代码示例。如果您正苦于以下问题:PHP eZSection::setGlobalID方法的具体用法?PHP eZSection::setGlobalID怎么用?PHP eZSection::setGlobalID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZSection
的用法示例。
在下文中一共展示了eZSection::setGlobalID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: contentViewRetrieve
static function contentViewRetrieve($file, $mtime, $args)
{
extract($args);
$cacheExpired = false;
// Read Cache file
if (!eZContentObject::isCacheExpired($mtime)) {
// $contents = $cacheFile->fetchContents();
$contents = file_get_contents($file);
$Result = unserialize($contents);
// Check if a no_cache key has been set in the viewcache, and
// return an eZClusterFileFailure if it has
if (isset($Result['no_cache'])) {
return new eZClusterFileFailure(3, "Cache has been disabled for this node");
}
// Check if cache has expired when cache_ttl is set
$cacheTTL = isset($Result['cache_ttl']) ? $Result['cache_ttl'] : -1;
if ($cacheTTL > 0) {
$expiryTime = $mtime + $cacheTTL;
if (time() > $expiryTime) {
$cacheExpired = true;
$expiryReason = 'Content cache is expired by cache_ttl=' . $cacheTTL;
}
}
// Check if template source files are newer, but only if the cache is not expired
if (!$cacheExpired) {
$developmentModeEnabled = $ini->variable('TemplateSettings', 'DevelopmentMode') == 'enabled';
// Only do filemtime checking when development mode is enabled.
if ($developmentModeEnabled && isset($Result['template_list'])) {
foreach ($Result['template_list'] as $templateFile) {
if (@filemtime($templateFile) > $mtime) {
$cacheExpired = true;
$expiryReason = "Content cache is expired by template file '" . $templateFile . "'";
break;
}
}
}
}
if (!$cacheExpired) {
$keyArray = array(array('object', $Result['content_info']['object_id']), array('node', $Result['content_info']['node_id']), array('parent_node', $Result['content_info']['parent_node_id']), array('class', $Result['content_info']['class_id']), array('view_offset', $Result['content_info']['offset']), array('navigation_part_identifier', $Result['content_info']['navigation_part_identifier']), array('viewmode', $Result['content_info']['viewmode']), array('depth', $Result['content_info']['node_depth']), array('remote_id', $Result['content_info']['remote_id']), array('node_remote_id', $Result['content_info']['node_remote_id']), array('url_alias', $Result['content_info']['url_alias']), array('persistent_variable', $Result['content_info']['persistent_variable']), array('class_group', $Result['content_info']['class_group']), array('parent_class_id', $Result['content_info']['parent_class_id']), array('parent_class_identifier', $Result['content_info']['parent_class_identifier']), array('state', $Result['content_info']['state']), array('state_identifier', $Result['content_info']['state_identifier']));
if (isset($Result['content_info']['class_identifier'])) {
$keyArray[] = array('class_identifier', $Result['content_info']['class_identifier']);
}
$res = eZTemplateDesignResource::instance();
$res->setKeys($keyArray);
// set section id
eZSection::setGlobalID($Result['section_id']);
return $Result;
}
} else {
$expiryReason = 'Content cache is expired by eZContentObject::isCacheExpired(' . $mtime . ")";
}
// Cache is expired so return specialized cluster object
if (!isset($expiryReason)) {
$expiryReason = 'Content cache is expired';
}
return new eZClusterFileFailure(1, $expiryReason);
}