当前位置: 首页>>代码示例>>PHP>>正文


PHP CacheManager::getCache方法代码示例

本文整理汇总了PHP中CacheManager::getCache方法的典型用法代码示例。如果您正苦于以下问题:PHP CacheManager::getCache方法的具体用法?PHP CacheManager::getCache怎么用?PHP CacheManager::getCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CacheManager的用法示例。


在下文中一共展示了CacheManager::getCache方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testGetCache

 /**
  * @covers Xoops\Core\Cache\CacheManager::getCache
  */
 public function testGetCache()
 {
     $pool1 = $this->object->getCache('default');
     $this->assertInstanceOf('Xoops\\Core\\Cache\\Access', $pool1);
     $pool2 = $this->object->getCache('nosuchpooldefinition');
     $this->assertInstanceOf('Xoops\\Core\\Cache\\Access', $pool2);
     $this->assertSame($pool1, $pool2);
 }
开发者ID:RanLee,项目名称:XoopsCore,代码行数:11,代码来源:CacheManagerTest.php

示例2: getCachingFrameworkRequiredDatabaseSchema

 /**
  * Get schema SQL of required cache framework tables.
  *
  * This method needs ext_localconf and ext_tables loaded!
  *
  * @return string Cache framework SQL
  */
 public function getCachingFrameworkRequiredDatabaseSchema()
 {
     // Use new to circumvent the singleton pattern of CacheManager
     $cacheManager = new CacheManager();
     $cacheManager->setCacheConfigurations($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']);
     // Cache manager needs cache factory. cache factory injects itself to manager in __construct()
     new CacheFactory('production', $cacheManager);
     $tableDefinitions = '';
     foreach ($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'] as $cacheName => $_) {
         $backend = $cacheManager->getCache($cacheName)->getBackend();
         if (method_exists($backend, 'getTableDefinitions')) {
             $tableDefinitions .= LF . $backend->getTableDefinitions();
         }
     }
     return $tableDefinitions;
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:23,代码来源:DatabaseSchemaService.php

示例3: array

<?php

/**
 * General example for the Cache component.
 *
 * @package Cache
 * @version 1.4.1
 * @copyright Copyright (C) 2005-2009 eZ Systems AS. All rights reserved.
 * @license http://ez.no/licenses/new_bsd New BSD License
 */
/**
 * Content view
 */
// Assuming that the ContentView cache has been initialized correctly in the
// index.php:
// First retreive tha cache you want to access from the manager.
$cache = CacheManager::getCache('ContentView');
// Prepare your data identification, use some attributes and a unique ID
$attributes = array('user' => $user, 'nodeid' => $NodeID, 'offset' => $Offset, 'layout' => $layout, 'lang' => $LanguageCode, 'vmode' => $ViewMode);
$id = getUniqueId($attributes, $viewParameters);
// Initialize data and try to grep from cache
$data = '';
if (($data = $cache->restore($id, $attributes)) === false) {
    // No data in cache or data has expired. Generate new data...
    // What ever exactly happens to create it in eZp.
    $data = generateMyData();
    // ... and store it inside the cache
    $cache->store($id, $attributes, $data);
}
// And that's all! : )
开发者ID:jacomyma,项目名称:GEXF-Atlas,代码行数:30,代码来源:example_ezpublish.php

示例4: getRoutingData

 /**
  * gets the cache from the cacheManager
  * 
  * @return array
  */
 public function getRoutingData()
 {
     return $this->manager->getCache();
 }
开发者ID:nirnanaaa,项目名称:xlix,代码行数:9,代码来源:CompilerFramework.php


注:本文中的CacheManager::getCache方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。