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 ) ); }