當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CacheManager::getManager方法代碼示例

本文整理匯總了PHP中CacheManager::getManager方法的典型用法代碼示例。如果您正苦於以下問題:PHP CacheManager::getManager方法的具體用法?PHP CacheManager::getManager怎麽用?PHP CacheManager::getManager使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CacheManager的用法示例。


在下文中一共展示了CacheManager::getManager方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: execute

 /**
  * Test locales.
  */
 function execute()
 {
     // Flush the file cache just to be certain we're using
     // the most recent stuff
     import('cache.CacheManager');
     $cacheManager =& CacheManager::getManager();
     $cacheManager->flush('locale');
     // Load plugins so that their locale data is included too
     $plugins = array();
     foreach (PluginRegistry::getCategories() as $category) {
         echo "Loading plugin category \"{$category}\"...\n";
         $morePlugins = PluginRegistry::loadCategory($category);
         if (is_array($morePlugins)) {
             $plugins += $morePlugins;
         }
     }
     foreach (Locale::getAllLocales() as $locale => $name) {
         if (!empty($this->locales) && !in_array($locale, $this->locales)) {
             continue;
         }
         if ($locale != MASTER_LOCALE) {
             echo "Testing locale \"{$name}\" ({$locale}) against reference locale " . MASTER_LOCALE . ".\n";
             $this->testLocale($locale, MASTER_LOCALE, $plugins);
             $this->testEmails($locale, MASTER_LOCALE);
         }
     }
 }
開發者ID:jalperin,項目名稱:harvester,代碼行數:30,代碼來源:localeCheck.php

示例2: clearDataCache

 /**
  * Clear the data cache files (needed because of direct tinkering
  * with settings tables)
  * @return boolean
  */
 function clearDataCache()
 {
     $cacheManager = CacheManager::getManager();
     $cacheManager->flush(null, CACHE_TYPE_FILE);
     $cacheManager->flush(null, CACHE_TYPE_OBJECT);
     return true;
 }
開發者ID:laelnasan,項目名稱:UTFPR-ojs,代碼行數:12,代碼來源:Upgrade.inc.php

示例3: getContents

 /**
  * Get the HTML contents for this block.
  * @param $templateMgr object
  * @return $string
  */
 function getContents(&$templateMgr)
 {
     $journal =& Request::getJournal();
     $cacheManager =& CacheManager::getManager();
     $cache =& $cacheManager->getFileCache('keywords_' . AppLocale::getLocale(), $journal->getId(), array(&$this, '_cacheMiss'));
     // If the cache is older than a couple of days, regenerate it
     if (time() - $cache->getCacheTime() > 60 * 60 * 24 * KEYWORD_BLOCK_CACHE_DAYS) {
         $cache->flush();
     }
     $keywords =& $cache->getContents();
     if (empty($keywords)) {
         return '';
     }
     // Get the max occurrences for all keywords
     $maxOccurs = array_shift(array_values($keywords));
     // Now sort the array alphabetically
     ksort($keywords);
     $page = Request::getRequestedPage();
     $op = Request::getRequestedOp();
     $templateMgr->assign_by_ref('cloudKeywords', $keywords);
     $templateMgr->assign_by_ref('maxOccurs', $maxOccurs);
     if ($page == 'index' && $op == 'index' || $page == 'issue' || $page == 'search') {
         return parent::getContents($templateMgr);
     } else {
         return '';
     }
 }
開發者ID:yuricampos,項目名稱:ojs,代碼行數:32,代碼來源:KeywordCloudBlockPlugin.inc.php

示例4: array

 /**
  * Get galley objects cache.
  * @return GenericCache
  */
 function &_getGalleyCache()
 {
     if (!isset($this->galleyCache)) {
         $cacheManager =& CacheManager::getManager();
         $this->galleyCache =& $cacheManager->getObjectCache('galley', 0, array(&$this, '_galleyCacheMiss'));
     }
     return $this->galleyCache;
 }
開發者ID:farhanabbas1983,項目名稱:ojs-1,代碼行數:12,代碼來源:ArticleGalleyDAO.inc.php

示例5: clearDataCache

 /**
  * Clear the data cache.
  */
 function clearDataCache($args, &$request)
 {
     $this->validate();
     import('lib.pkp.classes.cache.CacheManager');
     $cacheManager =& CacheManager::getManager($request);
     $cacheManager->flush();
     $request->redirect('admin');
 }
開發者ID:Rygbee,項目名稱:harvester,代碼行數:11,代碼來源:AdminFunctionsHandler.inc.php

示例6: _getCache

 /**
  * Get the submission cache.
  * @return Cache
  */
 function _getCache()
 {
     if (!isset($this->cache)) {
         $cacheManager = CacheManager::getManager();
         $this->cache = $cacheManager->getObjectCache('submissions', 0, array(&$this, '_cacheMiss'));
     }
     return $this->cache;
 }
開發者ID:energylevels,項目名稱:pkp-lib,代碼行數:12,代碼來源:SubmissionDAO.inc.php

示例7: array

 function &_getArticlesInSectionsCache()
 {
     if (!isset($this->articlesInSectionsCache)) {
         $cacheManager =& CacheManager::getManager();
         $this->articlesInSectionsCache =& $cacheManager->getObjectCache('articlesInSections', 0, array(&$this, '_articlesInSectionsCacheMiss'));
     }
     return $this->articlesInSectionsCache;
 }
開發者ID:jasonzou,項目名稱:OJS-2.4.6,代碼行數:8,代碼來源:PublishedArticleDAO.inc.php

示例8: array

 /**
  * Get supp file objects cache.
  * @return GenericCache
  */
 function &_getSuppFileCache()
 {
     if (!isset($this->suppFileCache)) {
         $cacheManager =& CacheManager::getManager();
         $this->suppFileCache =& $cacheManager->getObjectCache('suppfile', 0, array(&$this, '_suppFileCacheMiss'));
     }
     return $this->suppFileCache;
 }
開發者ID:farhanabbas1983,項目名稱:ojs-1,代碼行數:12,代碼來源:SuppFileDAO.inc.php

示例9: array

 function &_getCache()
 {
     if (!isset($this->cache)) {
         $cacheManager =& CacheManager::getManager();
         $this->cache =& $cacheManager->getObjectCache('monographs', 0, array(&$this, '_cacheMiss'));
     }
     return $this->cache;
 }
開發者ID:ramonsodoma,項目名稱:omp,代碼行數:8,代碼來源:MonographDAO.inc.php

示例10: array

 function &_getCache()
 {
     $settingCache =& Registry::get('siteSettingCache', true, null);
     if ($settingCache === null) {
         $cacheManager =& CacheManager::getManager();
         $settingCache = $cacheManager->getFileCache('siteSettings', 'site', array($this, '_cacheMiss'));
     }
     return $settingCache;
 }
開發者ID:master3395,項目名稱:CBPPlatform,代碼行數:9,代碼來源:SiteSettingsDAO.inc.php

示例11: import

 function &_getCache()
 {
     static $settingCache;
     if (!isset($settingCache)) {
         import('cache.CacheManager');
         $cacheManager =& CacheManager::getManager();
         $settingCache = $cacheManager->getCache('siteSettings', 'site', array($this, '_cacheMiss'));
     }
     return $settingCache;
 }
開發者ID:LiteratimBi,項目名稱:jupitertfn,代碼行數:10,代碼來源:SiteSettingsDAO.inc.php

示例12: _getCache

 /**
  * Get an issue cache by cache ID.
  * @param $cacheId string
  * @return GenericCache
  */
 function _getCache($cacheId)
 {
     if (!isset($this->caches)) {
         $this->caches = array();
     }
     if (!isset($this->caches[$cacheId])) {
         $cacheManager = CacheManager::getManager();
         $this->caches[$cacheId] = $cacheManager->getObjectCache('issues', $cacheId, array($this, '_cacheMiss'));
     }
     return $this->caches[$cacheId];
 }
開發者ID:bkroll,項目名稱:ojs,代碼行數:16,代碼來源:IssueDAO.inc.php

示例13: setUp

 protected function setUp()
 {
     $this->cacheManager = CacheManager::getManager();
     $this->cacheMisses = 0;
     if (!is_writable($this->cacheManager->getFileCachePath())) {
         $this->markTestSkipped('File cache path not writable.');
     } else {
         parent::setUp();
         $this->cacheManager->flush();
     }
 }
開發者ID:PublishingWithoutWalls,項目名稱:pkp-lib,代碼行數:11,代碼來源:FileCacheTest.php

示例14: clearDataCache

 /**
  * Clear the data cache.
  * @param $args array
  * @param $request PKPRequest
  */
 function clearDataCache($args, $request)
 {
     // Clear the CacheManager's caches
     $cacheManager = CacheManager::getManager();
     $cacheManager->flush();
     // Clear ADODB's cache
     $userDao = DAORegistry::getDAO('UserDAO');
     // As good as any
     $userDao->flushCache();
     $request->redirect(null, 'admin');
 }
開發者ID:jprk,項目名稱:pkp-lib,代碼行數:16,代碼來源:AdminFunctionsHandler.inc.php

示例15: array

 function &_getCache($journalId)
 {
     static $settingCache;
     if (!isset($settingCache)) {
         $settingCache = array();
     }
     if (!isset($settingCache[$journalId])) {
         $cacheManager =& CacheManager::getManager();
         $settingCache[$journalId] =& $cacheManager->getFileCache('journalSettings', $journalId, array($this, '_cacheMiss'));
     }
     return $settingCache[$journalId];
 }
開發者ID:philschatz,項目名稱:ojs,代碼行數:12,代碼來源:JournalSettingsDAO.inc.php


注:本文中的CacheManager::getManager方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。