/**
  * Initializes the cache for this command.
  *
  * @return void
  */
 protected function initializeCache()
 {
     try {
         $this->cacheInstance = $this->cacheManager->getCache('tx_solr');
     } catch (NoSuchCacheException $e) {
         $this->cacheInstance = $this->cacheFactory->create('tx_solr', $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tx_solr']['frontend'], $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tx_solr']['backend'], $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tx_solr']['options']);
     }
 }
Example #2
0
 /**
  *
  */
 public function initializeObject()
 {
     try {
         $this->cacheInstance = $this->cacheManager->getCache(self::CACHE_NAME);
     } catch (NoSuchCacheException $e) {
         $this->cacheInstance = $this->cacheFactory->create(self::CACHE_NAME, $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['typo3forum_main']['frontend'], $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['typo3forum_main']['backend'], $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['typo3forum_main']['options']);
     }
 }
Example #3
0
 /**
  * Instantiates the cache for $identifier.
  *
  * @param string $identifier
  * @return void
  */
 protected function createCache($identifier)
 {
     if (isset($this->cacheConfigurations[$identifier]['frontend'])) {
         $frontend = $this->cacheConfigurations[$identifier]['frontend'];
     } else {
         $frontend = $this->defaultCacheConfiguration['frontend'];
     }
     if (isset($this->cacheConfigurations[$identifier]['backend'])) {
         $backend = $this->cacheConfigurations[$identifier]['backend'];
     } else {
         $backend = $this->defaultCacheConfiguration['backend'];
     }
     if (isset($this->cacheConfigurations[$identifier]['options'])) {
         $backendOptions = $this->cacheConfigurations[$identifier]['options'];
     } else {
         $backendOptions = $this->defaultCacheConfiguration['options'];
     }
     // Add the cache identifier to the groups that it should be attached to, or use the default ones.
     if (isset($this->cacheConfigurations[$identifier]['groups']) && is_array($this->cacheConfigurations[$identifier]['groups'])) {
         $assignedGroups = $this->cacheConfigurations[$identifier]['groups'];
     } else {
         $assignedGroups = $this->defaultCacheConfiguration['groups'];
     }
     foreach ($assignedGroups as $groupIdentifier) {
         if (!isset($this->cacheGroups[$groupIdentifier])) {
             $this->cacheGroups[$groupIdentifier] = array();
         }
         $this->cacheGroups[$groupIdentifier][] = $identifier;
     }
     $this->cacheFactory->create($identifier, $frontend, $backend, $backendOptions);
 }
Example #4
0
 /**
  * Get the cache to retrieve labels.
  *
  * @return \TYPO3\CMS\Core\Cache\Cache
  */
 private function getCache()
 {
     if ($this->cache === null) {
         try {
             $this->cache = $this->cacheManager->getCache('tev_label_label_cache');
         } catch (NoSuchCacheException $e) {
             $this->cache = $this->cacheFactory->create('tev_label_label_cache', $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tev_label_label_cache']['frontend'], $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tev_label_label_cache']['backend'], $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tev_label_label_cache']['options']);
         }
     }
     return $this->cache;
 }
Example #5
0
 /**
  * Instantiates the cache for $identifier.
  *
  * @param string $identifier
  * @return void
  */
 protected function createCache($identifier)
 {
     if (isset($this->cacheConfigurations[$identifier]['frontend'])) {
         $frontend = $this->cacheConfigurations[$identifier]['frontend'];
     } else {
         $frontend = $this->defaultCacheConfiguration['frontend'];
     }
     if (isset($this->cacheConfigurations[$identifier]['backend'])) {
         $backend = $this->cacheConfigurations[$identifier]['backend'];
     } else {
         $backend = $this->defaultCacheConfiguration['backend'];
     }
     if (isset($this->cacheConfigurations[$identifier]['options'])) {
         $backendOptions = $this->cacheConfigurations[$identifier]['options'];
     } else {
         $backendOptions = $this->defaultCacheConfiguration['options'];
     }
     $this->cacheFactory->create($identifier, $frontend, $backend, $backendOptions);
 }
 private function initializeCache()
 {
     $this->cacheManager = $GLOBALS['typo3CacheManager'];
     $this->cacheFactory = $GLOBALS['typo3CacheFactory'];
     try {
         $this->cache = $this->cacheManager->getCache(static::$CACHE_NAMESPACE);
     } catch (\TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException $e) {
         $this->cache = $this->cacheFactory->create(static::$CACHE_NAMESPACE, $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][static::$CACHE_NAMESPACE]['frontend'], $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][static::$CACHE_NAMESPACE]['backend'], $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][static::$CACHE_NAMESPACE]['options']);
     }
 }