本文整理匯總了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);
}