function &_getCache($tocId)
 {
     $cache =& Registry::get('helpTocCache', true, null);
     $locale = Help::getLocale();
     if (!isset($cache[$locale][$tocId])) {
         $help =& Help::getHelp();
         $cacheManager =& CacheManager::getManager();
         $cache[$locale][$tocId] = $cacheManager->getFileCache('help-toc-' . $help->getLocale(), $tocId, array($this, '_cacheMiss'));
         // Check to see if the cache info is outdated.
         $cacheTime = $cache[$locale][$tocId]->getCacheTime();
         if ($cacheTime !== null && $cacheTime < filemtime($this->getFilename($tocId))) {
             // The cached data is out of date.
             $cache[$locale][$tocId]->flush();
         }
     }
     return $cache[$locale][$tocId];
 }
Esempio n. 2
0
 function &_getCache($topicId)
 {
     static $cache;
     $locale = Help::getLocale();
     if (!isset($cache[$locale][$topicId])) {
         import('cache.CacheManager');
         $help =& Help::getHelp();
         $cacheManager =& CacheManager::getManager();
         $cache[$locale][$topicId] = $cacheManager->getFileCache('help-topic-' . $locale, $topicId, array($this, '_cacheMiss'));
         // Check to see if the cache info is outdated.
         $cacheTime = $cache[$locale][$topicId]->getCacheTime();
         if ($cacheTime !== null && $cacheTime < filemtime($this->getFilename($topicId))) {
             // The cached data is out of date.
             $cache[$locale][$topicId]->flush();
         }
     }
     return $cache[$locale][$topicId];
 }