예제 #1
0
 static function getLastPageRevision($nPageId)
 {
     self::debug("Getting last revision for page : " . $nPageId);
     //TODO
     $bSkipLoadingTranslationsContent = false;
     $bSkipLoadingContent = false;
     $bCachingEnabled = AnwComponent::globalCfgCachePagesEnabled();
     $sCacheKey = $bSkipLoadingTranslationsContent . '-' . $bSkipLoadingContent;
     try {
         //try to read it from cache in case of current page exists
         if (!$bCachingEnabled) {
             throw new AnwCacheNotFoundException();
         }
         $oLastPageRevision = AnwCache::getCachedPageById($nPageId, $sCacheKey);
     } catch (AnwCacheNotFoundException $e) {
         $oLastPageRevision = self::getDriver()->getLastPageRevision($nPageId);
         //dont put it in cache as it may be an archive...
     }
     return $oLastPageRevision;
 }