コード例 #1
0
ファイル: TemplateView.php プロジェクト: romac/Powered
 /**
  * Initializes the cache framework
  *
  * @return void
  */
 protected function initializeCache()
 {
     $this->cacheManager = $GLOBALS['typo3CacheManager'];
     try {
         $this->cache = $this->cacheManager->getCache(self::CACHE_IDENTIFIER);
     } catch (t3lib_cache_exception_NoSuchCache $exception) {
         $this->cache = $GLOBALS['typo3CacheFactory']->create(self::CACHE_IDENTIFIER, 't3lib_cache_frontend_VariableFrontend', 't3lib_cache_backend_FileBackend', array('cacheDirectory' => 'typo3temp/tx_powered/cache'));
     }
 }
コード例 #2
0
 /**
  * Initializes the Reflection Service
  *
  * @return void
  */
 protected function initializeReflection()
 {
     self::$reflectionService = t3lib_div::makeInstance('Tx_Extbase_Reflection_Service');
     self::$reflectionService->setCache($this->cacheManager->getCache('cache_extbase_reflection'));
     if (!self::$reflectionService->isInitialized()) {
         self::$reflectionService->initialize();
     }
 }
コード例 #3
0
ファイル: Bootstrap.php プロジェクト: NaveedWebdeveloper/Test
 /**
  * Initializes the Reflection Service
  *
  * @return void
  * @see initialize()
  */
 protected function initializeReflection()
 {
     $this->reflectionService = $this->objectManager->get('Tx_Extbase_Reflection_Service');
     $this->reflectionService->setDataCache($this->cacheManager->getCache('cache_extbase_reflection'));
     if (!$this->reflectionService->isInitialized()) {
         $this->reflectionService->initialize();
     }
 }
コード例 #4
0
ファイル: CacheProvider.php プロジェクト: romac/Powered
 /**
  * Get a cache frontend by its identifier.
  *
  * @param string $cacheIdentifier The cache identifier.
  * @return t3lib_cache_frontend_FrontendInterface The cache frontend.
  * @author Romain Ruetschi <*****@*****.**>
  */
 public function getCache($cacheIdentifier)
 {
     return $this->cacheManager->getCache($cacheIdentifier);
 }
コード例 #5
0
 /**
  * @test
  * @author Robert Lemke <*****@*****.**>
  * @author Ingo Renner <*****@*****.**>
  * @expectedException t3lib_cache_exception_NoSuchCache
  */
 public function getCacheThrowsExceptionForNonExistingIdentifier()
 {
     $manager = new t3lib_cache_Manager();
     $backend = $this->getMock('t3lib_cache_backend_AbstractBackend', array(), array(), '', FALSE);
     $cache = $this->getMock('t3lib_cache_frontend_AbstractFrontend', array('getIdentifier', 'set', 'get', 'getByTag', 'has', 'remove', 'flush', 'flushByTag'), array(), '', FALSE);
     $cache->expects($this->atLeastOnce())->method('getIdentifier')->will($this->returnValue('someidentifier'));
     $manager->registerCache($cache);
     $manager->getCache('someidentifier');
     $manager->getCache('doesnotexist');
 }