[BUGFIX] Increase performance of exports for caches 51/24051/2
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:29:50 +0000 (16:29 +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
(cherry picked from commit 8167fb19bc4539814a222185a8380be9add2e465)
Reviewed-on: https://review.typo3.org/24051

typo3/sysext/backend/Classes/Sprite/SpriteManager.php
typo3/sysext/core/Classes/Core/Bootstrap.php
typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php

index 591211d..3078990 100644 (file)
@@ -110,8 +110,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 e84c75c..8a3144e 100644 (file)
@@ -844,9 +844,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 9e104cb..e1df5e7 100644 (file)
@@ -1672,9 +1672,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);