コード例 #1
0
ファイル: class_parser.php プロジェクト: MenZil-Team/anwiki
 private function getAnwloopFetchItems($nLoopLimit, $sLoopClass, $sLoopMatch, $asLoopLangs, $sLoopSort, $sLoopOrder, $asLoopFilters, $bDoCaching, $nLoopCacheTime)
 {
     $aoLoopsItems = array();
     try {
         //try to get it from cache
         if (!$bDoCaching) {
             throw new AnwCacheNotFoundException();
         }
         $sCacheKey = implode('-', array($nLoopLimit, $sLoopClass, $sLoopMatch, implode('.', $asLoopLangs), $sLoopSort, $sLoopOrder, md5(serialize($asLoopFilters))));
         $aoLoopsItems = AnwCache_loops::getCachedLoop($this->oPage->getId(), $sCacheKey, $nLoopCacheTime);
     } catch (AnwCacheNotFoundException $e) {
         //cache not found or disabled
         //fetch loop datas from database
         $aoLoopsItems = AnWiki::tag_anwloop($sLoopMatch, $sLoopClass, $asLoopLangs, $nLoopLimit, $sLoopSort, $sLoopOrder, $asLoopFilters);
         if ($bDoCaching) {
             //put result in cache for next time
             AnwCache_loops::putCachedLoop($this->oPage->getId(), $sCacheKey, $aoLoopsItems);
         }
     }
     return $aoLoopsItems;
 }