[BUGFIX] Increase performance of exports for caches 69/23969/5
authorMarkus Klein <klein.t3@mfc-linz.at>
Mon, 23 Sep 2013 10:20:01 +0000 (12:20 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 25 Sep 2013 14:28:55 +0000 (16:28 +0200)
Exporting arrays for caches is now done with var_export().

Resolves: #51116
Releases: 6.2, 6.1, 6.0
Change-Id: I7519fd9c2ab21cc22a3f4e092b611c6bca58c30f
Reviewed-on: https://review.typo3.org/23969
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
Reviewed-by: Helmut Hummel
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/backend/Classes/Sprite/SpriteManager.php
typo3/sysext/core/Classes/Core/Bootstrap.php
typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php

index e5fde19..7a8faa5 100644 (file)
@@ -113,8 +113,9 @@ class SpriteManager {
                // 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 . '\'));';
+
+               $cacheFileContent = '$GLOBALS[\'TBE_STYLES\'][\'spriteIconApi\'][\'iconsAvailable\'] = ';
+               $cacheFileContent .= var_export($iconNames, TRUE) . ';';
                /** @var $codeCache \TYPO3\CMS\Core\Cache\Frontend\PhpFrontend */
                $GLOBALS['typo3CacheManager']->getCache('cache_core')->set(static::getCacheIdentifier(), $cacheFileContent);
        }
index 3b2388e..cf14469 100644 (file)
@@ -857,9 +857,7 @@ class Bootstrap {
                        $codeCache->requireOnce($cacheIdentifier);
                } else {
                        $this->loadExtensionTables(TRUE);
-                       $phpCodeToCache = '$GLOBALS[\'TCA\'] = ';
-                       $phpCodeToCache .= Utility\ArrayUtility::arrayExport($GLOBALS['TCA']);
-                       $phpCodeToCache .= ';';
+                       $phpCodeToCache = '$GLOBALS[\'TCA\'] = ' . var_export($GLOBALS['TCA'], TRUE) . ';';
                        $codeCache->set($cacheIdentifier, $phpCodeToCache);
                }
                return $this;
index d2d37ed..8bf88f2 100644 (file)
@@ -1675,9 +1675,7 @@ tt_content.' . $key . $prefix . ' {
         * @return void
         */
        static protected function createBaseTcaCacheFile() {
-               $phpCodeToCache = '$GLOBALS[\'TCA\'] = ';
-               $phpCodeToCache .= ArrayUtility::arrayExport($GLOBALS['TCA']);
-               $phpCodeToCache .= ';';
+               $phpCodeToCache = '$GLOBALS[\'TCA\'] = ' . var_export($GLOBALS['TCA'], TRUE) . ';';
                /** @var $codeCache \TYPO3\CMS\Core\Cache\Frontend\PhpFrontend */
                $codeCache = $GLOBALS['typo3CacheManager']->getCache('cache_core');
                $codeCache->set(static::getBaseTcaCacheIdentifier(), $phpCodeToCache);