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