本文整理汇总了PHP中eZExpiryHandler::getTimestamp方法的典型用法代码示例。如果您正苦于以下问题:PHP eZExpiryHandler::getTimestamp方法的具体用法?PHP eZExpiryHandler::getTimestamp怎么用?PHP eZExpiryHandler::getTimestamp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZExpiryHandler
的用法示例。
在下文中一共展示了eZExpiryHandler::getTimestamp方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle
static function handle( $cachePath, $nodeID, $ttl, $useGlobalExpiry = true )
{
$globalExpiryTime = -1;
eZExpiryHandler::registerShutdownFunction();
if ( $useGlobalExpiry )
{
$globalExpiryTime = eZExpiryHandler::getTimestamp( 'template-block-cache', -1 );
}
$cacheHandler = eZClusterFileHandler::instance( $cachePath );
$subtreeExpiry = -1;
// Perform an extra check if the DB handler is in use,
// get the modified_subnode value from the specified node ($nodeID)
// and use it as an extra expiry value.
if ( $cacheHandler instanceof eZDBFileHandler or $cacheHandler instanceof eZDFSFileHandler )
{
$subtreeExpiry = eZTemplateCacheBlock::getSubtreeModification( $nodeID );
}
$globalExpiryTime = max( eZExpiryHandler::getTimestamp( 'global-template-block-cache', -1 ), // This expiry value is the true global expiry for cache-blocks
$globalExpiryTime,
$subtreeExpiry );
if ( $ttl == 0 )
$ttl = -1;
return array( &$cacheHandler,
$cacheHandler->processCache( array( 'eZTemplateCacheBlock', 'retrieveContent' ), null,
$ttl, $globalExpiryTime ) );
}
示例2: processCached
function processCached($tpl, $functionChildren, $rootNamespace, $currentNamespace, $placementString, $keys, $subtreeExpiry, $expiry, $ignoreContentExpiry)
{
// Fetch the current siteaccess
$accessName = false;
if (isset($GLOBALS['eZCurrentAccess']['name'])) {
$accessName = $GLOBALS['eZCurrentAccess']['name'];
}
if ($keys === null) {
$keyArray = array($placementString, $accessName);
} else {
$keyArray = array($keys, $placementString, $accessName);
}
$nodeID = $subtreeExpiry ? eZTemplateCacheBlock::decodeNodeID($subtreeExpiry) : false;
$phpPath = eZTemplateCacheBlock::cachePath(eZTemplateCacheBlock::keyString($keyArray), $nodeID);
$ttl = $expiry > 0 ? $expiry : null;
if ($subtreeExpiry !== null) {
$ignoreContentExpiry = true;
} else {
if ($ignoreContentExpiry === null) {
$ignoreContentExpiry = false;
}
}
$globalExpiryTime = -1;
if ($ignoreContentExpiry == false) {
$globalExpiryTime = eZExpiryHandler::getTimestamp('template-block-cache', -1);
}
$globalExpiryTime = max(eZExpiryHandler::getTimestamp('global-template-block-cache', -1), $globalExpiryTime);
// Check if we can restore
$cacheFile = eZClusterFileHandler::instance($phpPath);
$args = array("tpl" => $tpl, "functionChildren" => $functionChildren, "rootNamespace" => $rootNamespace, "currentNamespace" => $currentNamespace);
return $cacheFile->processCache(array('eZTemplateCacheBlock', 'retrieveContent'), array($this, 'generateProcessedContent'), $ttl, $globalExpiryTime, $args);
}