Пример #1
0
 /**
  * Initialize sprite manager.
  * Loads registered sprite configuration from cache, or
  * rebuilds new cache before registration.
  *
  * @return void
  */
 public static function initialize()
 {
     if (!static::isInitialized()) {
         $cacheIdentifier = static::getCacheIdentifier();
         /** @var $codeCache \TYPO3\CMS\Core\Cache\Frontend\PhpFrontend */
         $codeCache = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Cache\CacheManager::class)->getCache('cache_core');
         if ($codeCache->has($cacheIdentifier)) {
             $codeCache->requireOnce($cacheIdentifier);
         } else {
             static::buildSpriteDataAndCreateCacheEntry();
         }
         self::$isInitialized = TRUE;
     }
 }
Пример #2
0
 /**
  * Initialize sprite manager.
  * Loads registered sprite configuration from cache, or
  * rebuilds new cache before registration.
  *
  * @return void
  */
 public static function initialize()
 {
     if (!static::isInitialized()) {
         $cacheIdentifier = static::getCacheIdentifier();
         /** @var $codeCache \TYPO3\CMS\Core\Cache\Frontend\PhpFrontend */
         $codeCache = $GLOBALS['typo3CacheManager']->getCache('cache_core');
         if ($codeCache->has($cacheIdentifier)) {
             $codeCache->requireOnce($cacheIdentifier);
         } else {
             static::createSpriteCache();
             $codeCache->requireOnce($cacheIdentifier);
         }
         self::$isInitialized = TRUE;
     }
 }