[BUGFIX] Sprite manager cache improvement
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Classes / Sprite / SpriteManager.php
index e8ad238..e5fde19 100644 (file)
@@ -66,8 +66,7 @@ class SpriteManager {
                        if ($codeCache->has($cacheIdentifier)) {
                                $codeCache->requireOnce($cacheIdentifier);
                        } else {
-                               static::createSpriteCache();
-                               $codeCache->requireOnce($cacheIdentifier);
+                               static::buildSpriteDataAndCreateCacheEntry();
                        }
                        self::$isInitialized = TRUE;
                }
@@ -83,15 +82,15 @@ class SpriteManager {
        }
 
        /**
-        * Compile sprite icon cache by calling the registered generator.
+        * Set up sprite icon data and create cache entry calling the registered generator.
         *
         * Stuff the compiled $GLOBALS['TBE_STYLES']['spriteIconApi']['iconsAvailable']
-        * global into php code cache
+        * global into php code cache.
         *
         * @throws \RuntimeException
         * @return void
         */
-       static protected function createSpriteCache() {
+       static protected function buildSpriteDataAndCreateCacheEntry() {
                $handlerClass = $GLOBALS['TYPO3_CONF_VARS']['BE']['spriteIconGenerator_handler'];
                /** @var $handler \TYPO3\CMS\Backend\Sprite\SpriteIconGeneratorInterface */
                $handler = GeneralUtility::makeInstance($handlerClass);
@@ -113,6 +112,7 @@ class SpriteManager {
                // Merge icon names provided by the skin, with
                // registered "complete sprites" and the handler class
                $iconNames = array_merge($availableSkinIcons, (array) $GLOBALS['TBE_STYLES']['spritemanager']['spriteIconsAvailable'], $handler->getAvailableIconNames());
+               $GLOBALS['TBE_STYLES']['spriteIconApi']['iconsAvailable'] = $iconNames;
                $cacheString = addslashes(serialize($iconNames));
                $cacheFileContent = '$GLOBALS[\'TBE_STYLES\'][\'spriteIconApi\'][\'iconsAvailable\'] = unserialize(stripslashes(\'' . $cacheString . '\'));';
                /** @var $codeCache \TYPO3\CMS\Core\Cache\Frontend\PhpFrontend */