[!!!][TASK] Streamline caching framework caches 61/59661/7
authorBenni Mack <benni@typo3.org>
Thu, 7 Feb 2019 10:10:58 +0000 (11:10 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Thu, 16 May 2019 09:58:59 +0000 (11:58 +0200)
Due to some heavy history on the caching framework, all
Database caches start with "cf_cache_", which is optimized
so they are only called e.g. "cache_pagesection" in the database tables.

In addition, the prefix "cache_" (in e.g. "cache_core") is unnecessary,
and also there due to legacy reasons, reading $this->getCache('cache_runtime')
seems very illogical.

The following caches have been renamed:
- cache_core => core
- cache_hash => hash
- cache_pages => pages
- cache_pagesection => pagesection
- cache_runtime => runtime
- cache_rootline => rootline
- cache_imagesizes => imagesizes

Old identifiers can still be called within PHP,
but the caching framework throws a deprecation message
on setting up such a cache.

A silent upgrade wizard will update one's LocalConfiguration
to use the new naming scheme.

The result is a cleaner, more readable and more streamlined
code base (we have caches like "extbase" or "assets" where
there is no prefix) and database structure.

The patch is breaking due to the change in the database tables.

Resolves: #88366
Releases: master
Change-Id: I13dcdb0d1bf78f0899615e850856de081b715358
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/59661
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
68 files changed:
composer.json
composer.lock
typo3/sysext/backend/Classes/Backend/Avatar/Avatar.php
typo3/sysext/backend/Classes/Configuration/TsConfigParser.php
typo3/sysext/backend/Classes/Form/Utility/FormEngineUtility.php
typo3/sysext/backend/Classes/Utility/BackendUtility.php
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaSelectItemsTest.php
typo3/sysext/backend/Tests/Unit/Form/InlineStackProcessorTest.php
typo3/sysext/backend/Tests/Unit/Utility/BackendUtilityTest.php
typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php
typo3/sysext/core/Classes/Cache/Backend/Typo3DatabaseBackend.php
typo3/sysext/core/Classes/Cache/CacheManager.php
typo3/sysext/core/Classes/Cache/Frontend/AbstractFrontend.php
typo3/sysext/core/Classes/Configuration/SiteConfiguration.php
typo3/sysext/core/Classes/Core/Bootstrap.php
typo3/sysext/core/Classes/DataHandling/DataHandler.php
typo3/sysext/core/Classes/Database/ConnectionPool.php
typo3/sysext/core/Classes/Database/ReferenceIndex.php
typo3/sysext/core/Classes/ExpressionLanguage/ProviderConfigurationLoader.php
typo3/sysext/core/Classes/Hooks/SiteDataHandlerCacheHook.php
typo3/sysext/core/Classes/Http/AbstractApplication.php
typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php
typo3/sysext/core/Classes/Page/PageRenderer.php
typo3/sysext/core/Classes/PageTitle/PageTitleProviderManager.php
typo3/sysext/core/Classes/Routing/SiteMatcher.php
typo3/sysext/core/Classes/Service/MarkerBasedTemplateService.php
typo3/sysext/core/Classes/TypoScript/TemplateService.php
typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php
typo3/sysext/core/Classes/Utility/GeneralUtility.php
typo3/sysext/core/Classes/Utility/RootlineUtility.php
typo3/sysext/core/Configuration/DefaultConfiguration.php
typo3/sysext/core/Documentation/Changelog/master/Breaking-87583-RemoveObsoleteAPCCacheBackendImplementation.rst
typo3/sysext/core/Documentation/Changelog/master/Breaking-88366-RemovedCf_PrefixOfCacheTables.rst [new file with mode: 0644]
typo3/sysext/core/Documentation/Changelog/master/Deprecation-88366-DefaultCachingFrameworkCacheNamesChanged.rst [new file with mode: 0644]
typo3/sysext/core/Tests/Functional/Cache/Backend/MemcachedBackendTest.php
typo3/sysext/core/Tests/Functional/Cache/Backend/RedisBackendTest.php
typo3/sysext/core/Tests/Functional/Cache/Backend/Typo3DatabaseBackendTest.php
typo3/sysext/core/Tests/Functional/Cache/Frontend/VariableFrontendTest.php
typo3/sysext/core/Tests/Functional/DataHandling/AbstractDataHandlerActionTestCase.php
typo3/sysext/core/Tests/Unit/Cache/Backend/Typo3DatabaseBackendTest.php
typo3/sysext/core/Tests/Unit/Configuration/FlexForm/FlexFormToolsTest.php
typo3/sysext/core/Tests/Unit/Configuration/TypoScript/ConditionMatching/AbstractConditionMatcherTest.php
typo3/sysext/core/Tests/Unit/DataHandling/DataHandlerTest.php
typo3/sysext/core/Tests/Unit/ExpressionLanguage/ResolverTest.php
typo3/sysext/core/Tests/Unit/Resource/ResourceStorageTest.php
typo3/sysext/core/Tests/Unit/TypoScript/Parser/TypoScriptParserTest.php
typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php
typo3/sysext/core/Tests/Unit/Utility/RootlineUtilityTest.php
typo3/sysext/core/composer.json
typo3/sysext/form/Classes/Domain/Model/Renderable/AbstractRenderable.php
typo3/sysext/form/Classes/Mvc/Persistence/FormPersistenceManager.php
typo3/sysext/form/Tests/Unit/Controller/FormFrontendControllerTest.php
typo3/sysext/form/Tests/Unit/Hooks/DataStructureIdentifierHookTest.php
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
typo3/sysext/frontend/Classes/Page/PageRepository.php
typo3/sysext/frontend/Classes/Typolink/PageLinkBuilder.php
typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php
typo3/sysext/frontend/Tests/Unit/Controller/TypoScriptFrontendControllerTest.php
typo3/sysext/indexed_search/Classes/Domain/Repository/AdministrationRepository.php
typo3/sysext/install/Classes/Service/SilentConfigurationUpgradeService.php
typo3/sysext/install/Tests/Unit/Service/SilentConfigurationUpgradeServiceTest.php
typo3/sysext/lowlevel/Classes/Controller/ConfigurationController.php
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php
typo3/sysext/recycler/Classes/Controller/DeletedRecordsController.php
typo3/sysext/recycler/Classes/Domain/Model/DeletedRecords.php
typo3/sysext/redirects/Classes/Service/RedirectCacheService.php

index bb77208..6a378ab 100644 (file)
@@ -72,7 +72,7 @@
                "friendsofphp/php-cs-fixer": "^2.12.2",
                "phpspec/prophecy": "^1.7.5",
                "typo3/cms-styleguide": "~10.0.2",
-               "typo3/testing-framework": "~5.0.7"
+               "typo3/testing-framework": "~5.0.9"
        },
        "suggest": {
                "ext-gd": "GDlib/Freetype is required for building images with text (GIFBUILDER) and can also be used to scale images",
index 08c2707..033bd1f 100644 (file)
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "d2fb17662a3d483385e72f9cd8937b60",
+    "content-hash": "870e3918ae3d5aa74326217313e58454",
     "packages": [
         {
             "name": "cogpowered/finediff",
         },
         {
             "name": "typo3/testing-framework",
-            "version": "5.0.7",
+            "version": "5.0.9",
             "source": {
                 "type": "git",
                 "url": "https://github.com/TYPO3/testing-framework.git",
-                "reference": "f6be4a637106eb90cb58491d67b92e50e1b6c8dc"
+                "reference": "bf7a5b7f1bc481ec791716a7fa33e3ed94215bdc"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/TYPO3/testing-framework/zipball/f6be4a637106eb90cb58491d67b92e50e1b6c8dc",
-                "reference": "f6be4a637106eb90cb58491d67b92e50e1b6c8dc",
+                "url": "https://api.github.com/repos/TYPO3/testing-framework/zipball/bf7a5b7f1bc481ec791716a7fa33e3ed94215bdc",
+                "reference": "bf7a5b7f1bc481ec791716a7fa33e3ed94215bdc",
                 "shasum": ""
             },
             "require": {
                 "mikey179/vfsstream": "~1.6.0",
-                "phpunit/phpunit": "^7.5.6",
+                "phpunit/phpunit": "^7.5.6 || ^8",
                 "typo3/cms-backend": "10.*.*@dev",
                 "typo3/cms-core": "10.*.*@dev",
                 "typo3/cms-extbase": "10.*.*@dev",
                 "typo3fluid/fluid": "^2.5"
             },
             "suggest": {
-                "codeception/codeception": "^2.4",
+                "codeception/codeception": "^3",
                 "typo3/cms-styleguide": "^9.0"
             },
             "type": "library",
                 "tests",
                 "typo3"
             ],
-            "time": "2019-03-23T16:23:15+00:00"
+            "time": "2019-05-16T08:49:46+00:00"
         }
     ],
     "aliases": [],
index c67cab7..97dc110 100644 (file)
@@ -203,6 +203,6 @@ class Avatar
      */
     protected function getCache()
     {
-        return GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_runtime');
+        return GeneralUtility::makeInstance(CacheManager::class)->getCache('runtime');
     }
 }
index 240681c..d0413ff 100644 (file)
@@ -55,7 +55,7 @@ class TsConfigParser extends \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser
         $this->rootLine = $rootLine;
         $hash = md5($type . ':' . $TStext);
 
-        $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_hash');
+        $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('hash');
         $cachedContent = $cache->get($hash);
         if (is_array($cachedContent)) {
             $storedData = $cachedContent[0];
index e7d0a4a..29685cd 100644 (file)
@@ -96,7 +96,7 @@ class FormEngineUtility
      */
     public static function getTSconfigForTableRow($table, $row, $field = '')
     {
-        $runtimeCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_runtime');
+        $runtimeCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('runtime');
         $cache = $runtimeCache->get('formEngineUtilityTsConfigForTableRow') ?: [];
         $cacheIdentifier = $table . ':' . $row['uid'];
         if (!isset($cache[$cacheIdentifier])) {
index 78e4007..6ad482c 100644 (file)
@@ -326,7 +326,7 @@ class BackendUtility
      */
     public static function BEgetRootLine($uid, $clause = '', $workspaceOL = false, array $additionalFields = [])
     {
-        $runtimeCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_runtime');
+        $runtimeCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('runtime');
         $beGetRootLineCache = $runtimeCache->get('backendUtilityBeGetRootLine') ?: [];
         $output = [];
         $pid = $uid;
@@ -401,7 +401,7 @@ class BackendUtility
      */
     protected static function getPageForRootline($uid, $clause, $workspaceOL, array $additionalFields = [])
     {
-        $runtimeCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_runtime');
+        $runtimeCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('runtime');
         $pageForRootlineCache = $runtimeCache->get('backendUtilityPageForRootLine') ?: [];
         $ident = $uid . '-' . $clause . '-' . $workspaceOL . ($additionalFields ? '-' . md5(implode(',', $additionalFields)) : '');
         if (is_array($pageForRootlineCache[$ident] ?? false)) {
@@ -3156,7 +3156,7 @@ class BackendUtility
      */
     public static function getTSCpidCached($table, $uid, $pid)
     {
-        $runtimeCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_runtime');
+        $runtimeCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('runtime');
         $firstLevelCache = $runtimeCache->get('backendUtilityTscPidCached') ?: [];
         $key = $table . ':' . $uid . ':' . $pid;
         if (!isset($firstLevelCache[$key])) {
@@ -3219,7 +3219,7 @@ class BackendUtility
      */
     protected static function getRuntimeCache()
     {
-        return GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_runtime');
+        return GeneralUtility::makeInstance(CacheManager::class)->getCache('runtime');
     }
 
     /**
index 3cbaa01..beef0cc 100644 (file)
@@ -62,7 +62,7 @@ class TcaSelectItemsTest extends UnitTestCase
 
         $cacheManagerProphecy = $this->prophesize(CacheManager::class);
         $cacheProphecy = $this->prophesize(FrontendInterface::class);
-        $cacheManagerProphecy->getCache('cache_runtime')->willReturn($cacheProphecy->reveal());
+        $cacheManagerProphecy->getCache('runtime')->willReturn($cacheProphecy->reveal());
         $cacheProphecy->get(Argument::cetera())->willReturn(false);
         $cacheProphecy->set(Argument::cetera())->willReturn(false);
         GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManagerProphecy->reveal());
index abf3702..3d12299 100644 (file)
@@ -40,7 +40,7 @@ class InlineStackProcessorTest extends UnitTestCase
         parent::setUp();
         $cacheManagerProphecy = $this->prophesize(CacheManager::class);
         $cacheProphecy = $this->prophesize(FrontendInterface::class);
-        $cacheManagerProphecy->getCache('cache_runtime')->willReturn($cacheProphecy->reveal());
+        $cacheManagerProphecy->getCache('runtime')->willReturn($cacheProphecy->reveal());
         $cacheProphecy->get(Argument::cetera())->willReturn(false);
         $cacheProphecy->set(Argument::cetera())->willReturn(false);
         GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManagerProphecy->reveal());
index d0d844a..9c91130 100644 (file)
@@ -1041,10 +1041,10 @@ class BackendUtilityTest extends UnitTestCase
 
         $cacheManagerProphecy = $this->prophesize(CacheManager::class);
         $cacheProphecy = $this->prophesize(FrontendInterface::class);
-        $cacheManagerProphecy->getCache('cache_runtime')->willReturn($cacheProphecy->reveal());
+        $cacheManagerProphecy->getCache('runtime')->willReturn($cacheProphecy->reveal());
         $cacheHashProphecy = $this->prophesize(FrontendInterface::class);
         $cacheManagerProphecy->hasCache('extbase')->willReturn(false);
-        $cacheManagerProphecy->getCache('cache_hash')->willReturn($cacheHashProphecy->reveal());
+        $cacheManagerProphecy->getCache('hash')->willReturn($cacheHashProphecy->reveal());
         $cacheProphecy->has(Argument::cetera())->willReturn(false);
         $cacheProphecy->get(Argument::cetera())->willReturn(false);
         $cacheProphecy->set(Argument::cetera())->willReturn(false);
index 6df0c5f..3a92f3d 100644 (file)
@@ -1298,7 +1298,7 @@ class BackendUserAuthentication extends AbstractUserAuthentication
             $this->userTS_text = implode(LF . '[GLOBAL]' . LF, $this->TSdataArray);
             // Parsing the user TSconfig (or getting from cache)
             $hash = md5('userTS:' . $this->userTS_text);
-            $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_hash');
+            $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('hash');
             $parseObj = GeneralUtility::makeInstance(\TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser::class);
             $parseObj->parse($this->userTS_text);
             $this->userTS = $parseObj->setup;
@@ -1555,7 +1555,7 @@ class BackendUserAuthentication extends AbstractUserAuthentication
      */
     public function getFileMountRecords()
     {
-        $runtimeCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_runtime');
+        $runtimeCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('runtime');
         $fileMountRecordCache = $runtimeCache->get('backendUserAuthenticationFileMountRecords') ?: [];
 
         if (!empty($fileMountRecordCache)) {
index 1bd9a0c..68f60b4 100644 (file)
@@ -64,8 +64,8 @@ class Typo3DatabaseBackend extends AbstractBackend implements TaggableBackendInt
     public function setCache(FrontendInterface $cache)
     {
         parent::setCache($cache);
-        $this->cacheTable = 'cf_' . $this->cacheIdentifier;
-        $this->tagsTable = 'cf_' . $this->cacheIdentifier . '_tags';
+        $this->cacheTable = 'cache_' . $this->cacheIdentifier;
+        $this->tagsTable = 'cache_' . $this->cacheIdentifier . '_tags';
         $this->maximumLifetime = self::FAKED_UNLIMITED_EXPIRE - $GLOBALS['EXEC_TIME'];
     }
 
index 1d64271..c7b2cda 100644 (file)
@@ -127,6 +127,11 @@ class CacheManager implements SingletonInterface
      */
     public function getCache($identifier)
     {
+        // Fallback layer, will be removed in TYPO3 v11.0.
+        if (strpos($identifier, 'cache_') === 0) {
+            trigger_error('Accessing a cache with the "cache_" prefix as in "' . $identifier . '" is not necessary anymore, and should be called without the cache prefix.', E_USER_DEPRECATED);
+            $identifier = substr($identifier, 6);
+        }
         if ($this->hasCache($identifier) === false) {
             throw new NoSuchCacheException('A cache with identifier "' . $identifier . '" does not exist.', 1203699034);
         }
@@ -144,6 +149,11 @@ class CacheManager implements SingletonInterface
      */
     public function hasCache($identifier)
     {
+        // Fallback layer, will be removed in TYPO3 v11.0.
+        if (strpos($identifier, 'cache_') === 0) {
+            trigger_error('Accessing a cache with the "cache_" prefix as in "' . $identifier . '" is not necessary anymore, and should be called without the cache prefix.', E_USER_DEPRECATED);
+            $identifier = substr($identifier, 6);
+        }
         return isset($this->caches[$identifier]) || isset($this->cacheConfigurations[$identifier]);
     }
 
index 55d975c..b13fe83 100644 (file)
@@ -48,6 +48,10 @@ abstract class AbstractFrontend implements FrontendInterface
         if (preg_match(self::PATTERN_ENTRYIDENTIFIER, $identifier) !== 1) {
             throw new \InvalidArgumentException('"' . $identifier . '" is not a valid cache identifier.', 1203584729);
         }
+        if (strpos($identifier, 'cache_') === 0) {
+            trigger_error('Setting up a cache as in "' . $identifier . '" with the "cache_" prefix is not necessary anymore, and should be called without the cache prefix.', E_USER_DEPRECATED);
+            $identifier = substr($identifier, 6);
+        }
         $this->identifier = $identifier;
         $this->backend = $backend;
         $this->backend->setCache($this);
index 30943d0..76a97e5 100644 (file)
@@ -199,6 +199,6 @@ class SiteConfiguration
      */
     protected function getCache(): FrontendInterface
     {
-        return GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_core');
+        return GeneralUtility::makeInstance(CacheManager::class)->getCache('core');
     }
 }
index 53688c8..baae88c 100644 (file)
@@ -86,7 +86,7 @@ class Bootstrap
         $disableCaching = $failsafe ? true : false;
 
         $logManager = new LogManager($requestId);
-        $coreCache = static::createCache('cache_core', $disableCaching);
+        $coreCache = static::createCache('core', $disableCaching);
         $packageManager = static::createPackageManager(
             $failsafe ? FailsafePackageManager::class : PackageManager::class,
             $coreCache
@@ -317,7 +317,7 @@ class Bootstrap
     public static function loadTypo3LoadedExtAndExtLocalconf($allowCaching = true, FrontendInterface $coreCache = null)
     {
         if ($allowCaching) {
-            $coreCache = $coreCache ?? GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_core');
+            $coreCache = $coreCache ?? GeneralUtility::makeInstance(CacheManager::class)->getCache('core');
         }
         ExtensionManagementUtility::loadExtLocalconf($allowCaching, $coreCache);
     }
@@ -543,7 +543,7 @@ class Bootstrap
     public static function loadBaseTca(bool $allowCaching = true, FrontendInterface $coreCache = null)
     {
         if ($allowCaching) {
-            $coreCache = $coreCache ?? GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_core');
+            $coreCache = $coreCache ?? GeneralUtility::makeInstance(CacheManager::class)->getCache('core');
         }
         ExtensionManagementUtility::loadBaseTca($allowCaching, $coreCache);
     }
@@ -608,7 +608,7 @@ class Bootstrap
         $cacheIdentifier = 'BackendRoutesFromPackages_' . sha1(TYPO3_version . Environment::getProjectPath() . 'BackendRoutesFromPackages');
 
         /** @var \TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $codeCache */
-        $codeCache = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Cache\CacheManager::class)->getCache('cache_core');
+        $codeCache = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Cache\CacheManager::class)->getCache('core');
         $routesFromPackages = [];
         if ($codeCache->has($cacheIdentifier)) {
             // substr is necessary, because the php frontend wraps php code around the cache value
index a914f20..bf282d1 100644 (file)
@@ -7980,7 +7980,7 @@ class DataHandler implements LoggerAwareInterface
      *
      * The following cache_* are intentionally not cleared by 'all'
      *
-     * - cache_imagesizes:     Clearing this table would cause a lot of unneeded
+     * - imagesizes:   Clearing this table would cause a lot of unneeded
      * Imagemagick calls because the size informations have
      * to be fetched again after clearing.
      * - all caches inside the cache manager that are inside the group "system"
@@ -8344,7 +8344,7 @@ class DataHandler implements LoggerAwareInterface
      */
     protected function getRuntimeCache()
     {
-        return $this->getCacheManager()->getCache('cache_runtime');
+        return $this->getCacheManager()->getCache('runtime');
     }
 
     /**
index a64229a..6890e8d 100644 (file)
@@ -143,7 +143,7 @@ class ConnectionPool
             $connectionParams['charset'] = 'utf8';
         }
 
-        // Force consistent handling of binary objects across datbase platforms
+        // Force consistent handling of binary objects across database platforms
         // MySQL returns strings by default, PostgreSQL streams.
         if (strpos($connectionParams['driver'], 'pdo_') === 0) {
             $connectionParams['driverOptions'][\PDO::ATTR_STRINGIFY_FETCHES] = true;
index c6c8cb0..db3756f 100644 (file)
@@ -157,7 +157,7 @@ class ReferenceIndex implements LoggerAwareInterface
      */
     public function __construct()
     {
-        $this->runtimeCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_runtime');
+        $this->runtimeCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('runtime');
     }
 
     /**
index 3896f63..e90ab08 100644 (file)
@@ -26,7 +26,7 @@ class ProviderConfigurationLoader
             PackageManager::class,
             GeneralUtility::makeInstance(DependencyOrderingService::class)
         );
-        $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_core');
+        $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('core');
 
         if ($cache->has($this->cacheIdentifier)) {
             /** @noinspection PhpUndefinedMethodInspection the method require() will be added to the interface in TYPO3 v10.0 */
index 25ad969..e526e61 100644 (file)
@@ -76,6 +76,6 @@ class SiteDataHandlerCacheHook
      */
     protected function getCache(): FrontendInterface
     {
-        return GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_core');
+        return GeneralUtility::makeInstance(CacheManager::class)->getCache('core');
     }
 }
index 909df57..66627a7 100644 (file)
@@ -45,7 +45,7 @@ abstract class AbstractApplication implements ApplicationInterface
         $resolver = new MiddlewareStackResolver(
             GeneralUtility::makeInstance(\TYPO3\CMS\Core\Package\PackageManager::class),
             GeneralUtility::makeInstance(\TYPO3\CMS\Core\Service\DependencyOrderingService::class),
-            GeneralUtility::makeInstance(\TYPO3\CMS\Core\Cache\CacheManager::class)->getCache('cache_core')
+            GeneralUtility::makeInstance(\TYPO3\CMS\Core\Cache\CacheManager::class)->getCache('core')
         );
         $middlewares = $resolver->resolve($this->middlewareStack);
 
index c1808fb..742f29c 100644 (file)
@@ -2195,7 +2195,7 @@ class GraphicalFunctions
         $identifier = $this->generateCacheKeyForImageFile($filePath);
 
         /** @var \TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $cache */
-        $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_imagesizes');
+        $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('imagesizes');
         $imageDimensions = [
             'hash'        => $statusHash,
             'imagewidth'  => $identifyResult[0],
@@ -2219,7 +2219,7 @@ class GraphicalFunctions
         $statusHash = $this->generateStatusHashForImageFile($filePath);
         $identifier = $this->generateCacheKeyForImageFile($filePath);
         /** @var \TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $cache */
-        $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_imagesizes');
+        $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('imagesizes');
         $cachedImageDimensions = $cache->get($identifier);
         if (!isset($cachedImageDimensions['hash'])) {
             return false;
index 43958b8..5f6b9f2 100644 (file)
@@ -1674,7 +1674,7 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface
         $metaTags = [];
         $metaTagManagers = $this->metaTagRegistry->getAllManagers();
         try {
-            $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_pages');
+            $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('pages');
         } catch (NoSuchCacheException $e) {
             $cache = null;
         }
index d093a99..7e182f5 100644 (file)
@@ -108,7 +108,7 @@ class PageTitleProviderManager implements SingletonInterface
     protected function initCaches(): void
     {
         try {
-            $this->pageCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_pages');
+            $this->pageCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('pages');
         } catch (NoSuchCacheException $e) {
             // Intended fall-through
         }
index 1b52cc5..cb07d4b 100644 (file)
@@ -74,7 +74,7 @@ class SiteMatcher implements SingletonInterface
     {
         /** Ensure root line caches are flushed */
         RootlineUtility::purgeCaches();
-        GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_rootline')->flush();
+        GeneralUtility::makeInstance(CacheManager::class)->getCache('rootline')->flush();
     }
 
     /**
index d71ef36..e2415c4 100644 (file)
@@ -510,7 +510,7 @@ class MarkerBasedTemplateService
      */
     protected function getCache()
     {
-        return GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_hash');
+        return GeneralUtility::makeInstance(CacheManager::class)->getCache('hash');
     }
 
     /**
@@ -520,6 +520,6 @@ class MarkerBasedTemplateService
      */
     protected function getRuntimeCache()
     {
-        return GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_runtime');
+        return GeneralUtility::makeInstance(CacheManager::class)->getCache('runtime');
     }
 }
index 12d9d06..6a6cada 100644 (file)
@@ -370,7 +370,7 @@ class TemplateService
      */
     public function getCurrentPageData()
     {
-        return GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_pagesection')->get((int)$this->getTypoScriptFrontendController()->id . '_' . GeneralUtility::md5int($this->getTypoScriptFrontendController()->MP));
+        return GeneralUtility::makeInstance(CacheManager::class)->getCache('pagesection')->get((int)$this->getTypoScriptFrontendController()->id . '_' . GeneralUtility::md5int($this->getTypoScriptFrontendController()->MP));
     }
 
     /**
@@ -503,7 +503,7 @@ class TemplateService
                 // Only save the data if we're not simulating by hidden/starttime/endtime
                 $mpvarHash = GeneralUtility::md5int($this->getTypoScriptFrontendController()->MP);
                 /** @var \TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $pageSectionCache */
-                $pageSectionCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_pagesection');
+                $pageSectionCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('pagesection');
                 $pageSectionCache->set((int)$this->getTypoScriptFrontendController()->id . '_' . $mpvarHash, $cc, [
                     'pageId_' . (int)$this->getTypoScriptFrontendController()->id,
                     'mpvarHash_' . $mpvarHash
@@ -1371,11 +1371,11 @@ class TemplateService
      */
     protected function getCacheEntry($identifier)
     {
-        return GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_hash')->get($identifier);
+        return GeneralUtility::makeInstance(CacheManager::class)->getCache('hash')->get($identifier);
     }
 
     /**
-     * Stores $data in the 'cache_hash' cache with the hash key $identifier
+     * Stores $data in the 'hash' cache with the hash key $identifier
      *
      * @param string $identifier 32 bit hash string (eg. a md5 hash of a serialized array identifying the data being stored)
      * @param mixed $data The data to store
@@ -1383,6 +1383,6 @@ class TemplateService
      */
     protected function setCacheEntry($identifier, $data, $tag)
     {
-        GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_hash')->set($identifier, $data, ['ident_' . $tag], 0);
+        GeneralUtility::makeInstance(CacheManager::class)->getCache('hash')->set($identifier, $data, ['ident_' . $tag], 0);
     }
 }
index 86aeee7..624439d 100644 (file)
@@ -1425,7 +1425,7 @@ tt_content.' . $key . $suffix . ' {
     public static function loadExtLocalconf($allowCaching = true, FrontendInterface $codeCache = null)
     {
         if ($allowCaching) {
-            $codeCache = $codeCache ?? self::getCacheManager()->getCache('cache_core');
+            $codeCache = $codeCache ?? self::getCacheManager()->getCache('core');
             $cacheIdentifier = self::getExtLocalconfCacheIdentifier();
             if ($codeCache->has($cacheIdentifier)) {
                 $codeCache->require($cacheIdentifier);
@@ -1513,7 +1513,7 @@ tt_content.' . $key . $suffix . ' {
     public static function loadBaseTca($allowCaching = true, FrontendInterface $codeCache = null)
     {
         if ($allowCaching) {
-            $codeCache = $codeCache ?? self::getCacheManager()->getCache('cache_core');
+            $codeCache = $codeCache ?? self::getCacheManager()->getCache('core');
             $cacheIdentifier = static::getBaseTcaCacheIdentifier();
             $cacheData = $codeCache->require($cacheIdentifier);
             if ($cacheData) {
@@ -1658,7 +1658,7 @@ tt_content.' . $key . $suffix . ' {
             self::$extTablesWasReadFromCacheOnce = true;
             $cacheIdentifier = self::getExtTablesCacheIdentifier();
             /** @var \TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $codeCache */
-            $codeCache = self::getCacheManager()->getCache('cache_core');
+            $codeCache = self::getCacheManager()->getCache('core');
             if ($codeCache->has($cacheIdentifier)) {
                 $codeCache->require($cacheIdentifier);
             } else {
@@ -1714,7 +1714,7 @@ tt_content.' . $key . $suffix . ' {
         $phpCodeToCache = implode(LF, $phpCodeToCache);
         // Remove all start and ending php tags from content
         $phpCodeToCache = preg_replace('/<\\?php|\\?>/is', '', $phpCodeToCache);
-        self::getCacheManager()->getCache('cache_core')->set(self::getExtTablesCacheIdentifier(), $phpCodeToCache);
+        self::getCacheManager()->getCache('core')->set(self::getExtTablesCacheIdentifier(), $phpCodeToCache);
     }
 
     /**
index 33f656d..4b66dd9 100644 (file)
@@ -1536,7 +1536,7 @@ class GeneralUtility
      */
     public static function xml2array($string, $NSprefix = '', $reportDocTag = false)
     {
-        $runtimeCache = static::makeInstance(CacheManager::class)->getCache('cache_runtime');
+        $runtimeCache = static::makeInstance(CacheManager::class)->getCache('runtime');
         $firstLevelCache = $runtimeCache->get('generalUtilityXml2Array') ?: [];
         $identifier = md5($string . $NSprefix . ($reportDocTag ? '1' : '0'));
         // Look up in first level cache
index d5147d9..3b624bf 100644 (file)
@@ -153,7 +153,7 @@ class RootlineUtility
         );
 
         if (self::$cache === null) {
-            self::$cache = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Cache\CacheManager::class)->getCache('cache_rootline');
+            self::$cache = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Cache\CacheManager::class)->getCache('rootline');
         }
         self::$rootlineFields = array_merge(self::$rootlineFields, GeneralUtility::trimExplode(',', $GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields'], true));
         self::$rootlineFields = array_unique(self::$rootlineFields);
index 1db9713..601c9b8 100644 (file)
@@ -130,7 +130,7 @@ return [
             'cacheConfigurations' => [
                 // The cache_core cache is is for core php code only and must
                 // not be abused by third party extensions.
-                'cache_core' => [
+                'core' => [
                     'frontend' => \TYPO3\CMS\Core\Cache\Frontend\PhpFrontend::class,
                     'backend' => \TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend::class,
                     'options' => [
@@ -138,13 +138,13 @@ return [
                     ],
                     'groups' => ['system']
                 ],
-                'cache_hash' => [
+                'hash' => [
                     'frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class,
                     'backend' => \TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend::class,
                     'options' => [],
                     'groups' => ['pages']
                 ],
-                'cache_pages' => [
+                'pages' => [
                     'frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class,
                     'backend' => \TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend::class,
                     'options' => [
@@ -152,7 +152,7 @@ return [
                     ],
                     'groups' => ['pages']
                 ],
-                'cache_pagesection' => [
+                'pagesection' => [
                     'frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class,
                     'backend' => \TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend::class,
                     'options' => [
@@ -161,13 +161,13 @@ return [
                     ],
                     'groups' => ['pages']
                 ],
-                'cache_runtime' => [
+                'runtime' => [
                     'frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class,
                     'backend' => \TYPO3\CMS\Core\Cache\Backend\TransientMemoryBackend::class,
                     'options' => [],
                     'groups' => []
                 ],
-                'cache_rootline' => [
+                'rootline' => [
                     'frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class,
                     'backend' => \TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend::class,
                     'options' => [
@@ -175,7 +175,7 @@ return [
                     ],
                     'groups' => ['pages']
                 ],
-                'cache_imagesizes' => [
+                'imagesizes' => [
                     'frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class,
                     'backend' => \TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend::class,
                     'options' => [
index 4e5685f..9fccd25 100644 (file)
@@ -33,11 +33,11 @@ configuration.
 
 Example before:
 
-:php:`$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_rootline']['backend'] = \TYPO3\CMS\Core\Cache\Backend\ApcBackend::class;`
+:php:`$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['rootline']['backend'] = \TYPO3\CMS\Core\Cache\Backend\ApcBackend::class;`
 
 Example after:
 
-:php:`$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_rootline']['backend'] = \TYPO3\CMS\Core\Cache\Backend\ApcuBackend::class;`
+:php:`$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['rootline']['backend'] = \TYPO3\CMS\Core\Cache\Backend\ApcuBackend::class;`
 
 
 .. index:: Backend, PHP-API, ext:core, NotScanned
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-88366-RemovedCf_PrefixOfCacheTables.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-88366-RemovedCf_PrefixOfCacheTables.rst
new file mode 100644 (file)
index 0000000..18bfd05
--- /dev/null
@@ -0,0 +1,38 @@
+.. include:: ../../Includes.txt
+
+=======================================================
+Breaking: #88366 - Removed "cf_" prefix of cache tables
+=======================================================
+
+See :issue:`88366`
+
+Description
+===========
+
+In addition, when the Typo3DatabaseBackend now accesses and creates tables without the "cf_"
+prefix ("cf" = Caching Framework), so caches in the database are simply called "cache_rootline"
+for instance.
+
+
+Impact
+======
+
+Accessing the database tables directly with a "cf_" prefix will not work on the TYPO3 managed
+cache tables.
+
+
+Affected Installations
+======================
+
+Any TYPO3 instance using the Caching Framework with a Typo3DatabaseBackend.
+
+
+Migration
+=========
+
+Use the Caching Framework directly.
+
+In addition, run through the Database Table Analyzer of the Configuration module to
+re-create any database tables of the Caching Framework.
+
+.. index:: Database, NotScanned, ext:core
\ No newline at end of file
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-88366-DefaultCachingFrameworkCacheNamesChanged.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-88366-DefaultCachingFrameworkCacheNamesChanged.rst
new file mode 100644 (file)
index 0000000..8b4c323
--- /dev/null
@@ -0,0 +1,55 @@
+.. include:: ../../Includes.txt
+
+===================================================================
+Deprecation: #88366 - Default caching framework cache names changed
+===================================================================
+
+See :issue:`88366`
+
+Description
+===========
+
+TYPO3's internal Caching Framework has several caches already shipped with TYPO3 Core.
+
+The caches have been renamed for convenience and for newcomers to overcome another "speciality"
+of TYPO3 which was due to legacy and integration reasons back in TYPO3 4.3 when the Caching
+Framework was introduced.
+
+The following caches have been renamed:
+
+- cache_core => core
+- cache_hash => hash
+- cache_pages => pages
+- cache_pagesection => pagesection
+- cache_runtime => runtime
+- cache_rootline => rootline
+- cache_imagesizes => imagesizes
+
+The caches should now be accessed via :php:`$cacheManager->getCache('core')` instead of
+:php:`$cacheManager->getCache('cache_core')` - without the "cache_" prefix.
+
+In addition, when the DatabaseBackend cache is used, the database tables do not have the `cf_`
+prefix anymore, making it clearer for integrators and developers what the caches mean.
+
+
+Impact
+======
+
+When accessing the cache with a "cache" prefix, a deprecation message is thrown.
+
+
+Affected Installations
+======================
+
+Any TYPO3 extension using the caching framework with the "cache_" prefix.
+
+
+Migration
+=========
+
+Remove the "cache_" prefix from the callers code.
+
+In addition, run through the Database Table Analyzer of the Configuration module to
+re-create any database tables of the Caching Framework.
+
+.. index:: Database, LocalConfiguration, NotScanned, ext:core
\ No newline at end of file
index 9c77fec..5f482c5 100644 (file)
@@ -88,7 +88,7 @@ class MemcachedBackendTest extends FunctionalTestCase
     public function itIsPossibleToSetAndCheckExistenceInCache()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         $subject = $this->initializeSubject();
         $subject->setCache($frontendProphecy->reveal());
@@ -104,7 +104,7 @@ class MemcachedBackendTest extends FunctionalTestCase
     public function itIsPossibleToSetAndGetEntry()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         $subject = $this->initializeSubject();
         $subject->setCache($frontendProphecy->reveal());
@@ -121,7 +121,7 @@ class MemcachedBackendTest extends FunctionalTestCase
     public function getReturnsPreviouslySetDataWithVariousTypes()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         $subject = $this->initializeSubject();
         $subject->setCache($frontendProphecy->reveal());
@@ -150,7 +150,7 @@ class MemcachedBackendTest extends FunctionalTestCase
     public function largeDataIsStored()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         $subject = $this->initializeSubject();
         $subject->setCache($frontendProphecy->reveal());
@@ -167,7 +167,7 @@ class MemcachedBackendTest extends FunctionalTestCase
     public function itIsPossibleToRemoveEntryFromCache()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         $subject = $this->initializeSubject();
         $subject->setCache($frontendProphecy->reveal());
@@ -185,7 +185,7 @@ class MemcachedBackendTest extends FunctionalTestCase
     public function itIsPossibleToOverwriteAnEntryInTheCache()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         $subject = $this->initializeSubject();
         $subject->setCache($frontendProphecy->reveal());
@@ -204,7 +204,7 @@ class MemcachedBackendTest extends FunctionalTestCase
     public function findIdentifiersByTagFindsCacheEntriesWithSpecifiedTag()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         $subject = $this->initializeSubject();
         $subject->setCache($frontendProphecy->reveal());
@@ -224,7 +224,7 @@ class MemcachedBackendTest extends FunctionalTestCase
     public function setRemovesTagsFromPreviousSet()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         $subject = $this->initializeSubject();
         $subject->setCache($frontendProphecy->reveal());
@@ -242,7 +242,7 @@ class MemcachedBackendTest extends FunctionalTestCase
     public function hasReturnsFalseIfTheEntryDoesntExist()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         $subject = $this->initializeSubject();
         $subject->setCache($frontendProphecy->reveal());
@@ -257,7 +257,7 @@ class MemcachedBackendTest extends FunctionalTestCase
     public function removeReturnsFalseIfTheEntryDoesntExist()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         $subject = $this->initializeSubject();
         $subject->setCache($frontendProphecy->reveal());
@@ -272,7 +272,7 @@ class MemcachedBackendTest extends FunctionalTestCase
     public function flushByTagRemovesCacheEntriesWithSpecifiedTag()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         $subject = $this->initializeSubject();
         $subject->setCache($frontendProphecy->reveal());
@@ -293,7 +293,7 @@ class MemcachedBackendTest extends FunctionalTestCase
     public function flushByTagsRemovesCacheEntriesWithSpecifiedTags()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         $subject = $this->initializeSubject();
         $subject->setCache($frontendProphecy->reveal());
@@ -314,7 +314,7 @@ class MemcachedBackendTest extends FunctionalTestCase
     public function flushRemovesAllCacheEntries()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         $subject = $this->initializeSubject();
         $subject->setCache($frontendProphecy->reveal());
index 2002b87..5a6fc09 100644 (file)
@@ -57,7 +57,7 @@ class RedisBackendTest extends FunctionalTestCase
         $backendOptions['port'] = is_string($env) ? (int)$env : 6379;
 
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         $subject = new RedisBackend('Testing', $backendOptions);
         $subject->setCache($frontendProphecy->reveal());
index 74290ec..3673786 100644 (file)
@@ -31,7 +31,7 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
     public function getReturnsPreviouslySetEntry()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         $subject = new Typo3DatabaseBackend('Testing');
         $subject->setCache($frontendProphecy->reveal());
@@ -46,7 +46,7 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
     public function getReturnsPreviouslySetEntryWithNewContentIfSetWasCalledMultipleTimes()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         $subject = new Typo3DatabaseBackend('Testing');
         $subject->setCache($frontendProphecy->reveal());
@@ -62,18 +62,18 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
     public function setInsertsDataWithTagsIntoCacheTable()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         $subject = new Typo3DatabaseBackend('Testing');
         $subject->setCache($frontendProphecy->reveal());
 
         $subject->set('myIdentifier', 'myData', ['aTag', 'anotherTag']);
 
-        $cacheTableConnection = (new ConnectionPool())->getConnectionForTable('cf_cache_pages');
-        $tagsTableConnection = (new ConnectionPool())->getConnectionForTable('cf_cache_pages_tags');
-        $this->assertSame(1, $cacheTableConnection->count('*', 'cf_cache_pages', ['identifier' => 'myIdentifier']));
-        $this->assertSame(1, $tagsTableConnection->count('*', 'cf_cache_pages_tags', ['identifier' => 'myIdentifier', 'tag' => 'aTag']));
-        $this->assertSame(1, $tagsTableConnection->count('*', 'cf_cache_pages_tags', ['identifier' => 'myIdentifier', 'tag' => 'anotherTag']));
+        $cacheTableConnection = (new ConnectionPool())->getConnectionForTable('cache_pages');
+        $tagsTableConnection = (new ConnectionPool())->getConnectionForTable('cache_pages_tags');
+        $this->assertSame(1, $cacheTableConnection->count('*', 'cache_pages', ['identifier' => 'myIdentifier']));
+        $this->assertSame(1, $tagsTableConnection->count('*', 'cache_pages_tags', ['identifier' => 'myIdentifier', 'tag' => 'aTag']));
+        $this->assertSame(1, $tagsTableConnection->count('*', 'cache_pages_tags', ['identifier' => 'myIdentifier', 'tag' => 'anotherTag']));
     }
 
     /**
@@ -82,7 +82,7 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
     public function setStoresCompressedContent()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         // Have backend with compression enabled
         $subject = new Typo3DatabaseBackend('Testing', ['compression' => true]);
@@ -91,10 +91,10 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
         $subject->set('myIdentifier', 'myCachedContent');
 
         $row = (new ConnectionPool())
-            ->getConnectionForTable('cf_cache_pages')
+            ->getConnectionForTable('cache_pages')
             ->select(
                 ['content'],
-                'cf_cache_pages',
+                'cache_pages',
                 ['identifier' => 'myIdentifier']
             )
             ->fetch();
@@ -109,7 +109,7 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
     public function getReturnsFalseIfNoCacheEntryExists()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         $subject = new Typo3DatabaseBackend('Testing');
         $subject->setCache($frontendProphecy->reveal());
@@ -123,11 +123,11 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
     public function getReturnsFalseForExpiredCacheEntry()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         // Push an expired row into db
-        (new ConnectionPool())->getConnectionForTable('cf_cache_pages')->insert(
-            'cf_cache_pages',
+        (new ConnectionPool())->getConnectionForTable('cache_pages')->insert(
+            'cache_pages',
             [
                 'identifier' => 'myIdentifier',
                 'expires' => $GLOBALS['EXEC_TIME'] - 60,
@@ -150,11 +150,11 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
     public function getReturnsNotExpiredCacheEntry()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         // Push a row into db
-        (new ConnectionPool())->getConnectionForTable('cf_cache_pages')->insert(
-            'cf_cache_pages',
+        (new ConnectionPool())->getConnectionForTable('cache_pages')->insert(
+            'cache_pages',
             [
                 'identifier' => 'myIdentifier',
                 'expires' => $GLOBALS['EXEC_TIME'] + 60,
@@ -177,11 +177,11 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
     public function getReturnsUnzipsNotExpiredCacheEntry()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         // Push a compressed row into db
-        (new ConnectionPool())->getConnectionForTable('cf_cache_pages')->insert(
-            'cf_cache_pages',
+        (new ConnectionPool())->getConnectionForTable('cache_pages')->insert(
+            'cache_pages',
             [
                 'identifier' => 'myIdentifier',
                 'expires' => $GLOBALS['EXEC_TIME'] + 60,
@@ -206,11 +206,11 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
     public function getReturnsEmptyStringUnzipped()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         // Push a compressed row into db
-        (new ConnectionPool())->getConnectionForTable('cf_cache_pages')->insert(
-            'cf_cache_pages',
+        (new ConnectionPool())->getConnectionForTable('cache_pages')->insert(
+            'cache_pages',
             [
                 'identifier' => 'myIdentifier',
                 'expires' => $GLOBALS['EXEC_TIME'] + 60,
@@ -235,7 +235,7 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
     public function hasReturnsFalseIfNoCacheEntryExists()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         $subject = new Typo3DatabaseBackend('Testing');
         $subject->setCache($frontendProphecy->reveal());
@@ -249,11 +249,11 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
     public function hasReturnsFalseForExpiredCacheEntry()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         // Push an expired row into db
-        (new ConnectionPool())->getConnectionForTable('cf_cache_pages')->insert(
-            'cf_cache_pages',
+        (new ConnectionPool())->getConnectionForTable('cache_pages')->insert(
+            'cache_pages',
             [
                 'identifier' => 'myIdentifier',
                 'expires' => $GLOBALS['EXEC_TIME'] - 60,
@@ -276,11 +276,11 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
     public function hasReturnsNotExpiredCacheEntry()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         // Push a row into db
-        (new ConnectionPool())->getConnectionForTable('cf_cache_pages')->insert(
-            'cf_cache_pages',
+        (new ConnectionPool())->getConnectionForTable('cache_pages')->insert(
+            'cache_pages',
             [
                 'identifier' => 'myIdentifier',
                 'expires' => $GLOBALS['EXEC_TIME'] + 60,
@@ -303,7 +303,7 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
     public function removeReturnsFalseIfNoEntryHasBeenRemoved()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         $subject = new Typo3DatabaseBackend('Testing');
         $subject->setCache($frontendProphecy->reveal());
@@ -317,11 +317,11 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
     public function removeReturnsTrueIfAnEntryHasBeenRemoved()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         // Push a row into db
-        (new ConnectionPool())->getConnectionForTable('cf_cache_pages')->insert(
-            'cf_cache_pages',
+        (new ConnectionPool())->getConnectionForTable('cache_pages')->insert(
+            'cache_pages',
             [
                 'identifier' => 'myIdentifier',
                 'expires' => $GLOBALS['EXEC_TIME'] + 60,
@@ -344,12 +344,12 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
     public function removeRemovesCorrectEntriesFromDatabase()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         // Add one cache row to remove and another one that shouldn't be removed
-        $cacheTableConnection = (new ConnectionPool())->getConnectionForTable('cf_cache_pages');
+        $cacheTableConnection = (new ConnectionPool())->getConnectionForTable('cache_pages');
         $cacheTableConnection->bulkInsert(
-            'cf_cache_pages',
+            'cache_pages',
             [
                 ['myIdentifier', $GLOBALS['EXEC_TIME'] + 60, 'myCachedContent'],
                 ['otherIdentifier', $GLOBALS['EXEC_TIME'] + 60, 'otherCachedContent'],
@@ -363,9 +363,9 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
         $subject->setCache($frontendProphecy->reveal());
 
         // Add a couple of tags
-        $tagsTableConnection = (new ConnectionPool())->getConnectionForTable('cf_cache_pages_tags');
+        $tagsTableConnection = (new ConnectionPool())->getConnectionForTable('cache_pages_tags');
         $tagsTableConnection->bulkInsert(
-            'cf_cache_pages_tags',
+            'cache_pages_tags',
             [
                 ['myIdentifier', 'aTag'],
                 ['myIdentifier', 'otherTag'],
@@ -378,12 +378,12 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
         $subject->remove('myIdentifier');
 
         // cache row with removed identifier has been removed, other one exists
-        $this->assertSame(0, $cacheTableConnection->count('*', 'cf_cache_pages', ['identifier' => 'myIdentifier']));
-        $this->assertSame(1, $cacheTableConnection->count('*', 'cf_cache_pages', ['identifier' => 'otherIdentifier']));
+        $this->assertSame(0, $cacheTableConnection->count('*', 'cache_pages', ['identifier' => 'myIdentifier']));
+        $this->assertSame(1, $cacheTableConnection->count('*', 'cache_pages', ['identifier' => 'otherIdentifier']));
 
         // tags of myIdentifier should have been removed, others exist
-        $this->assertSame(0, $tagsTableConnection->count('*', 'cf_cache_pages_tags', ['identifier' => 'myIdentifier']));
-        $this->assertSame(2, $tagsTableConnection->count('*', 'cf_cache_pages_tags', ['identifier' => 'otherIdentifier']));
+        $this->assertSame(0, $tagsTableConnection->count('*', 'cache_pages_tags', ['identifier' => 'myIdentifier']));
+        $this->assertSame(2, $tagsTableConnection->count('*', 'cache_pages_tags', ['identifier' => 'otherIdentifier']));
     }
 
     /**
@@ -436,14 +436,14 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
         $subject = $this->getSubjectObject(true);
         $subject->flushByTag('tagB');
 
-        $cacheTableConnection = (new ConnectionPool())->getConnectionForTable('cf_cache_pages');
-        $this->assertSame(0, $cacheTableConnection->count('*', 'cf_cache_pages', ['identifier' => 'idA']));
-        $this->assertSame(0, $cacheTableConnection->count('*', 'cf_cache_pages', ['identifier' => 'idB']));
-        $this->assertSame(1, $cacheTableConnection->count('*', 'cf_cache_pages', ['identifier' => 'idC']));
-        $tagsTableConnection = (new ConnectionPool())->getConnectionForTable('cf_cache_pages_tags');
-        $this->assertSame(0, $tagsTableConnection->count('*', 'cf_cache_pages_tags', ['identifier' => 'idA']));
-        $this->assertSame(0, $tagsTableConnection->count('*', 'cf_cache_pages_tags', ['identifier' => 'idB']));
-        $this->assertSame(2, $tagsTableConnection->count('*', 'cf_cache_pages_tags', ['identifier' => 'idC']));
+        $cacheTableConnection = (new ConnectionPool())->getConnectionForTable('cache_pages');
+        $this->assertSame(0, $cacheTableConnection->count('*', 'cache_pages', ['identifier' => 'idA']));
+        $this->assertSame(0, $cacheTableConnection->count('*', 'cache_pages', ['identifier' => 'idB']));
+        $this->assertSame(1, $cacheTableConnection->count('*', 'cache_pages', ['identifier' => 'idC']));
+        $tagsTableConnection = (new ConnectionPool())->getConnectionForTable('cache_pages_tags');
+        $this->assertSame(0, $tagsTableConnection->count('*', 'cache_pages_tags', ['identifier' => 'idA']));
+        $this->assertSame(0, $tagsTableConnection->count('*', 'cache_pages_tags', ['identifier' => 'idB']));
+        $this->assertSame(2, $tagsTableConnection->count('*', 'cache_pages_tags', ['identifier' => 'idC']));
     }
 
     /**
@@ -458,14 +458,14 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
         $subject = $this->getSubjectObject(true);
         $subject->flushByTags(['tagC', 'tagD']);
 
-        $cacheTableConnection = (new ConnectionPool())->getConnectionForTable('cf_cache_pages');
-        $this->assertSame(1, $cacheTableConnection->count('*', 'cf_cache_pages', ['identifier' => 'idA']));
-        $this->assertSame(0, $cacheTableConnection->count('*', 'cf_cache_pages', ['identifier' => 'idB']));
-        $this->assertSame(0, $cacheTableConnection->count('*', 'cf_cache_pages', ['identifier' => 'idC']));
-        $tagsTableConnection = (new ConnectionPool())->getConnectionForTable('cf_cache_pages_tags');
-        $this->assertSame(2, $tagsTableConnection->count('*', 'cf_cache_pages_tags', ['identifier' => 'idA']));
-        $this->assertSame(0, $tagsTableConnection->count('*', 'cf_cache_pages_tags', ['identifier' => 'idB']));
-        $this->assertSame(0, $tagsTableConnection->count('*', 'cf_cache_pages_tags', ['identifier' => 'idC']));
+        $cacheTableConnection = (new ConnectionPool())->getConnectionForTable('cache_pages');
+        $this->assertSame(1, $cacheTableConnection->count('*', 'cache_pages', ['identifier' => 'idA']));
+        $this->assertSame(0, $cacheTableConnection->count('*', 'cache_pages', ['identifier' => 'idB']));
+        $this->assertSame(0, $cacheTableConnection->count('*', 'cache_pages', ['identifier' => 'idC']));
+        $tagsTableConnection = (new ConnectionPool())->getConnectionForTable('cache_pages_tags');
+        $this->assertSame(2, $tagsTableConnection->count('*', 'cache_pages_tags', ['identifier' => 'idA']));
+        $this->assertSame(0, $tagsTableConnection->count('*', 'cache_pages_tags', ['identifier' => 'idB']));
+        $this->assertSame(0, $tagsTableConnection->count('*', 'cache_pages_tags', ['identifier' => 'idC']));
     }
 
     /**
@@ -494,14 +494,14 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
         $subject = $this->getSubjectObject(true, false);
         $subject->flushByTag('tagB');
 
-        $cacheTableConnection = (new ConnectionPool())->getConnectionForTable('cf_cache_pages');
-        $this->assertSame(0, $cacheTableConnection->count('*', 'cf_cache_pages', ['identifier' => 'idA']));
-        $this->assertSame(0, $cacheTableConnection->count('*', 'cf_cache_pages', ['identifier' => 'idB']));
-        $this->assertSame(1, $cacheTableConnection->count('*', 'cf_cache_pages', ['identifier' => 'idC']));
-        $tagsTableConnection = (new ConnectionPool())->getConnectionForTable('cf_cache_pages_tags');
-        $this->assertSame(0, $tagsTableConnection->count('*', 'cf_cache_pages_tags', ['identifier' => 'idA']));
-        $this->assertSame(0, $tagsTableConnection->count('*', 'cf_cache_pages_tags', ['identifier' => 'idB']));
-        $this->assertSame(2, $tagsTableConnection->count('*', 'cf_cache_pages_tags', ['identifier' => 'idC']));
+        $cacheTableConnection = (new ConnectionPool())->getConnectionForTable('cache_pages');
+        $this->assertSame(0, $cacheTableConnection->count('*', 'cache_pages', ['identifier' => 'idA']));
+        $this->assertSame(0, $cacheTableConnection->count('*', 'cache_pages', ['identifier' => 'idB']));
+        $this->assertSame(1, $cacheTableConnection->count('*', 'cache_pages', ['identifier' => 'idC']));
+        $tagsTableConnection = (new ConnectionPool())->getConnectionForTable('cache_pages_tags');
+        $this->assertSame(0, $tagsTableConnection->count('*', 'cache_pages_tags', ['identifier' => 'idA']));
+        $this->assertSame(0, $tagsTableConnection->count('*', 'cache_pages_tags', ['identifier' => 'idB']));
+        $this->assertSame(2, $tagsTableConnection->count('*', 'cache_pages_tags', ['identifier' => 'idC']));
     }
 
     /**
@@ -512,14 +512,14 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
         $subject = $this->getSubjectObject(true, false);
         $subject->flushByTags(['tagC', 'tagD']);
 
-        $cacheTableConnection = (new ConnectionPool())->getConnectionForTable('cf_cache_pages');
-        $this->assertSame(1, $cacheTableConnection->count('*', 'cf_cache_pages', ['identifier' => 'idA']));
-        $this->assertSame(0, $cacheTableConnection->count('*', 'cf_cache_pages', ['identifier' => 'idB']));
-        $this->assertSame(0, $cacheTableConnection->count('*', 'cf_cache_pages', ['identifier' => 'idC']));
-        $tagsTableConnection = (new ConnectionPool())->getConnectionForTable('cf_cache_pages_tags');
-        $this->assertSame(2, $tagsTableConnection->count('*', 'cf_cache_pages_tags', ['identifier' => 'idA']));
-        $this->assertSame(0, $tagsTableConnection->count('*', 'cf_cache_pages_tags', ['identifier' => 'idB']));
-        $this->assertSame(0, $tagsTableConnection->count('*', 'cf_cache_pages_tags', ['identifier' => 'idC']));
+        $cacheTableConnection = (new ConnectionPool())->getConnectionForTable('cache_pages');
+        $this->assertSame(1, $cacheTableConnection->count('*', 'cache_pages', ['identifier' => 'idA']));
+        $this->assertSame(0, $cacheTableConnection->count('*', 'cache_pages', ['identifier' => 'idB']));
+        $this->assertSame(0, $cacheTableConnection->count('*', 'cache_pages', ['identifier' => 'idC']));
+        $tagsTableConnection = (new ConnectionPool())->getConnectionForTable('cache_pages_tags');
+        $this->assertSame(2, $tagsTableConnection->count('*', 'cache_pages_tags', ['identifier' => 'idA']));
+        $this->assertSame(0, $tagsTableConnection->count('*', 'cache_pages_tags', ['identifier' => 'idB']));
+        $this->assertSame(0, $tagsTableConnection->count('*', 'cache_pages_tags', ['identifier' => 'idC']));
     }
 
     /**
@@ -545,7 +545,7 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
     public function collectGarbageRemovesCacheEntryWithExpiredLifetimeWithMysql()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         // Must be mocked here to test for "mysql" version implementation
         $subject = $this->getMockBuilder(Typo3DatabaseBackend::class)
@@ -563,9 +563,9 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
 
         $subject->collectGarbage();
 
-        $cacheTableConnection = (new ConnectionPool())->getConnectionForTable('cf_cache_pages');
-        $this->assertSame(0, $cacheTableConnection->count('*', 'cf_cache_pages', ['identifier' => 'idA']));
-        $this->assertSame(1, $cacheTableConnection->count('*', 'cf_cache_pages', ['identifier' => 'idB']));
+        $cacheTableConnection = (new ConnectionPool())->getConnectionForTable('cache_pages');
+        $this->assertSame(0, $cacheTableConnection->count('*', 'cache_pages', ['identifier' => 'idA']));
+        $this->assertSame(1, $cacheTableConnection->count('*', 'cache_pages', ['identifier' => 'idB']));
     }
 
     /**
@@ -578,7 +578,7 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
     public function collectGarbageRemovesTagEntriesForCacheEntriesWithExpiredLifetimeWithMysql()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         // Must be mocked here to test for "mysql" version implementation
         $subject = $this->getMockBuilder(Typo3DatabaseBackend::class)
@@ -596,9 +596,9 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
 
         $subject->collectGarbage();
 
-        $tagsTableConnection = (new ConnectionPool())->getConnectionForTable('cf_cache_pages_tags');
-        $this->assertSame(0, $tagsTableConnection->count('*', 'cf_cache_pages_tags', ['identifier' => 'idA']));
-        $this->assertSame(2, $tagsTableConnection->count('*', 'cf_cache_pages_tags', ['identifier' => 'idB']));
+        $tagsTableConnection = (new ConnectionPool())->getConnectionForTable('cache_pages_tags');
+        $this->assertSame(0, $tagsTableConnection->count('*', 'cache_pages_tags', ['identifier' => 'idA']));
+        $this->assertSame(2, $tagsTableConnection->count('*', 'cache_pages_tags', ['identifier' => 'idB']));
     }
 
     /**
@@ -611,7 +611,7 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
     public function collectGarbageRemovesOrphanedTagEntriesFromTagsTableWithMysql()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         // Must be mocked here to test for "mysql" version implementation
         $subject = $this->getMockBuilder(Typo3DatabaseBackend::class)
@@ -625,18 +625,18 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
         $subject->set('idA', 'dataA', ['tagA', 'tagB'], 60);
         $subject->set('idB', 'dataB', ['tagB', 'tagC'], 240);
 
-        $tagsTableConnection = (new ConnectionPool())->getConnectionForTable('cf_cache_pages_tags');
+        $tagsTableConnection = (new ConnectionPool())->getConnectionForTable('cache_pages_tags');
 
         // Push two orphaned tag row into db - tags that have no related cache record anymore for whatever reason
         $tagsTableConnection->insert(
-            'cf_cache_pages_tags',
+            'cache_pages_tags',
             [
                 'identifier' => 'idC',
                 'tag' => 'tagC'
             ]
         );
         $tagsTableConnection->insert(
-            'cf_cache_pages_tags',
+            'cache_pages_tags',
             [
                 'identifier' => 'idC',
                 'tag' => 'tagD'
@@ -647,9 +647,9 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
 
         $subject->collectGarbage();
 
-        $this->assertSame(0, $tagsTableConnection->count('*', 'cf_cache_pages_tags', ['identifier' => 'idA']));
-        $this->assertSame(2, $tagsTableConnection->count('*', 'cf_cache_pages_tags', ['identifier' => 'idB']));
-        $this->assertSame(0, $tagsTableConnection->count('*', 'cf_cache_pages_tags', ['identifier' => 'idC']));
+        $this->assertSame(0, $tagsTableConnection->count('*', 'cache_pages_tags', ['identifier' => 'idA']));
+        $this->assertSame(2, $tagsTableConnection->count('*', 'cache_pages_tags', ['identifier' => 'idB']));
+        $this->assertSame(0, $tagsTableConnection->count('*', 'cache_pages_tags', ['identifier' => 'idC']));
     }
 
     /**
@@ -658,7 +658,7 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
     public function collectGarbageWorksWithEmptyTableWithNonMysql()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         // Must be mocked here to test for "mysql" version implementation
         $subject = $this->getMockBuilder(Typo3DatabaseBackend::class)
@@ -677,7 +677,7 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
     public function collectGarbageRemovesCacheEntryWithExpiredLifetimeWithNonMysql()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         // Must be mocked here to test for "mysql" version implementation
         $subject = $this->getMockBuilder(Typo3DatabaseBackend::class)
@@ -695,9 +695,9 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
 
         $subject->collectGarbage();
 
-        $cacheTableConnection = (new ConnectionPool())->getConnectionForTable('cf_cache_pages');
-        $this->assertSame(0, $cacheTableConnection->count('*', 'cf_cache_pages', ['identifier' => 'idA']));
-        $this->assertSame(1, $cacheTableConnection->count('*', 'cf_cache_pages', ['identifier' => 'idB']));
+        $cacheTableConnection = (new ConnectionPool())->getConnectionForTable('cache_pages');
+        $this->assertSame(0, $cacheTableConnection->count('*', 'cache_pages', ['identifier' => 'idA']));
+        $this->assertSame(1, $cacheTableConnection->count('*', 'cache_pages', ['identifier' => 'idB']));
     }
 
     /**
@@ -706,7 +706,7 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
     public function collectGarbageRemovesTagEntriesForCacheEntriesWithExpiredLifetimeWithNonMysql()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         // Must be mocked here to test for "mysql" version implementation
         $subject = $this->getMockBuilder(Typo3DatabaseBackend::class)
@@ -724,9 +724,9 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
 
         $subject->collectGarbage();
 
-        $tagsTableConnection = (new ConnectionPool())->getConnectionForTable('cf_cache_pages_tags');
-        $this->assertSame(0, $tagsTableConnection->count('*', 'cf_cache_pages_tags', ['identifier' => 'idA']));
-        $this->assertSame(2, $tagsTableConnection->count('*', 'cf_cache_pages_tags', ['identifier' => 'idB']));
+        $tagsTableConnection = (new ConnectionPool())->getConnectionForTable('cache_pages_tags');
+        $this->assertSame(0, $tagsTableConnection->count('*', 'cache_pages_tags', ['identifier' => 'idA']));
+        $this->assertSame(2, $tagsTableConnection->count('*', 'cache_pages_tags', ['identifier' => 'idB']));
     }
 
     /**
@@ -735,7 +735,7 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
     public function collectGarbageRemovesOrphanedTagEntriesFromTagsTableWithNonMysql()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         // Must be mocked here to test for "mysql" version implementation
         $subject = $this->getMockBuilder(Typo3DatabaseBackend::class)
@@ -749,18 +749,18 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
         $subject->set('idA', 'dataA', ['tagA', 'tagB'], 60);
         $subject->set('idB', 'dataB', ['tagB', 'tagC'], 240);
 
-        $tagsTableConnection = (new ConnectionPool())->getConnectionForTable('cf_cache_pages_tags');
+        $tagsTableConnection = (new ConnectionPool())->getConnectionForTable('cache_pages_tags');
 
         // Push two orphaned tag row into db - tags that have no related cache record anymore for whatever reason
         $tagsTableConnection->insert(
-            'cf_cache_pages_tags',
+            'cache_pages_tags',
             [
                 'identifier' => 'idC',
                 'tag' => 'tagC'
             ]
         );
         $tagsTableConnection->insert(
-            'cf_cache_pages_tags',
+            'cache_pages_tags',
             [
                 'identifier' => 'idC',
                 'tag' => 'tagD'
@@ -771,9 +771,9 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
 
         $subject->collectGarbage();
 
-        $this->assertSame(0, $tagsTableConnection->count('*', 'cf_cache_pages_tags', ['identifier' => 'idA']));
-        $this->assertSame(2, $tagsTableConnection->count('*', 'cf_cache_pages_tags', ['identifier' => 'idB']));
-        $this->assertSame(0, $tagsTableConnection->count('*', 'cf_cache_pages_tags', ['identifier' => 'idC']));
+        $this->assertSame(0, $tagsTableConnection->count('*', 'cache_pages_tags', ['identifier' => 'idA']));
+        $this->assertSame(2, $tagsTableConnection->count('*', 'cache_pages_tags', ['identifier' => 'idB']));
+        $this->assertSame(0, $tagsTableConnection->count('*', 'cache_pages_tags', ['identifier' => 'idC']));
     }
 
     /**
@@ -782,7 +782,7 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
     public function flushLeavesCacheAndTagsTableEmpty()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         $subject = new Typo3DatabaseBackend('Testing');
         $subject->setCache($frontendProphecy->reveal());
@@ -791,10 +791,10 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
 
         $subject->flush();
 
-        $cacheTableConnection = (new ConnectionPool())->getConnectionForTable('cf_cache_pages');
-        $tagsTableConnection = (new ConnectionPool())->getConnectionForTable('cf_cache_pages_tags');
-        $this->assertSame(0, $cacheTableConnection->count('*', 'cf_cache_pages', []));
-        $this->assertSame(0, $tagsTableConnection->count('*', 'cf_cache_pages_tags', []));
+        $cacheTableConnection = (new ConnectionPool())->getConnectionForTable('cache_pages');
+        $tagsTableConnection = (new ConnectionPool())->getConnectionForTable('cache_pages_tags');
+        $this->assertSame(0, $cacheTableConnection->count('*', 'cache_pages', []));
+        $this->assertSame(0, $tagsTableConnection->count('*', 'cache_pages_tags', []));
     }
 
     /**
@@ -806,7 +806,7 @@ class Typo3DatabaseBackendTest extends \TYPO3\TestingFramework\Core\Functional\F
     protected function getSubjectObject($returnMockObject = false, $isConnectionMysql = true)
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_pages');
+        $frontendProphecy->getIdentifier()->willReturn('pages');
 
         if (!$returnMockObject) {
             $subject = new Typo3DatabaseBackend('Testing');
index 0e631b3..22ce6c5 100644 (file)
@@ -39,7 +39,7 @@ class VariableFrontendTest extends \TYPO3\TestingFramework\Core\Functional\Funct
         return [
             [
                 $arrayToSerialize,
-                'cache_pages',
+                'pages',
                 $arrayToSerialize,
             ]
         ];
index 605607c..2277d4a 100644 (file)
@@ -170,7 +170,7 @@ abstract class AbstractDataHandlerActionTestCase extends FunctionalTestCase
         $fileName = $this->instancePath . '/typo3conf/sites/testing/config.yaml';
         GeneralUtility::writeFile($fileName, $yamlFileContents);
         // Ensure that no other site configuration was cached before
-        $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_core');
+        $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('core');
         if ($cache->has('site-configuration')) {
             $cache->remove('site-configuration');
         }
index 3817ccc..f13bb4d 100644 (file)
@@ -36,12 +36,12 @@ class Typo3DatabaseBackendTest extends UnitTestCase
     public function setCacheCalculatesCacheTableName()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_test');
+        $frontendProphecy->getIdentifier()->willReturn('test');
 
         $subject = new Typo3DatabaseBackend('Testing');
         $subject->setCache($frontendProphecy->reveal());
 
-        $this->assertEquals('cf_cache_test', $subject->getCacheTable());
+        $this->assertEquals('cache_test', $subject->getCacheTable());
     }
 
     /**
@@ -50,12 +50,12 @@ class Typo3DatabaseBackendTest extends UnitTestCase
     public function setCacheCalculatesTagsTableName()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_test');
+        $frontendProphecy->getIdentifier()->willReturn('test');
 
         $subject = new Typo3DatabaseBackend('Testing');
         $subject->setCache($frontendProphecy->reveal());
 
-        $this->assertEquals('cf_cache_test_tags', $subject->getTagsTable());
+        $this->assertEquals('cache_test_tags', $subject->getTagsTable());
     }
 
     /**
@@ -75,7 +75,7 @@ class Typo3DatabaseBackendTest extends UnitTestCase
     public function setThrowsExceptionIfDataIsNotAString()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_test');
+        $frontendProphecy->getIdentifier()->willReturn('test');
 
         $subject = new Typo3DatabaseBackend('Testing');
         $subject->setCache($frontendProphecy->reveal());
@@ -158,14 +158,14 @@ class Typo3DatabaseBackendTest extends UnitTestCase
     public function flushRemovesAllCacheEntries()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_test');
+        $frontendProphecy->getIdentifier()->willReturn('test');
 
         $subject = new Typo3DatabaseBackend('Testing');
         $subject->setCache($frontendProphecy->reveal());
 
         $connectionProphet = $this->prophesize(Connection::class);
-        $connectionProphet->truncate('cf_cache_test')->shouldBeCalled()->willReturn(0);
-        $connectionProphet->truncate('cf_cache_test_tags')->shouldBeCalled()->willReturn(0);
+        $connectionProphet->truncate('cache_test')->shouldBeCalled()->willReturn(0);
+        $connectionProphet->truncate('cache_test_tags')->shouldBeCalled()->willReturn(0);
 
         $connectionPoolProphet = $this->prophesize(ConnectionPool::class);
         $connectionPoolProphet->getConnectionForTable(Argument::cetera())->willReturn($connectionProphet->reveal());
@@ -180,14 +180,14 @@ class Typo3DatabaseBackendTest extends UnitTestCase
     public function flushByTagCallsDeleteOnConnection()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_test');
+        $frontendProphecy->getIdentifier()->willReturn('test');
 
         $subject = new Typo3DatabaseBackend('Testing');
         $subject->setCache($frontendProphecy->reveal());
 
         $connectionProphet = $this->prophesize(Connection::class);
-        $connectionProphet->delete('cf_cache_test')->shouldBeCalled()->willReturn(0);
-        $connectionProphet->delete('cf_cache_test_tags')->shouldBeCalled()->willReturn(0);
+        $connectionProphet->delete('cache_test')->shouldBeCalled()->willReturn(0);
+        $connectionProphet->delete('cache_test_tags')->shouldBeCalled()->willReturn(0);
 
         $connectionPoolProphet = $this->prophesize(ConnectionPool::class);
         $connectionPoolProphet->getConnectionForTable(Argument::cetera())->willReturn($connectionProphet->reveal());
@@ -202,14 +202,14 @@ class Typo3DatabaseBackendTest extends UnitTestCase
     public function flushByTagsCallsDeleteOnConnection()
     {
         $frontendProphecy = $this->prophesize(FrontendInterface::class);
-        $frontendProphecy->getIdentifier()->willReturn('cache_test');
+        $frontendProphecy->getIdentifier()->willReturn('test');
 
         $subject = new Typo3DatabaseBackend('Testing');
         $subject->setCache($frontendProphecy->reveal());
 
         $connectionProphet = $this->prophesize(Connection::class);
-        $connectionProphet->delete('cf_cache_test')->shouldBeCalled()->willReturn(0);
-        $connectionProphet->delete('cf_cache_test_tags')->shouldBeCalled()->willReturn(0);
+        $connectionProphet->delete('cache_test')->shouldBeCalled()->willReturn(0);
+        $connectionProphet->delete('cache_test_tags')->shouldBeCalled()->willReturn(0);
 
         $connectionPoolProphet = $this->prophesize(ConnectionPool::class);
         $connectionPoolProphet->getConnectionForTable(Argument::cetera())->willReturn($connectionProphet->reveal());
index b4f911c..dd71138 100644 (file)
@@ -70,7 +70,7 @@ class FlexFormToolsTest extends UnitTestCase
         // Underlying static GeneralUtility::xml2array() uses caches that have to be mocked here
         $cacheManagerProphecy = $this->prophesize(CacheManager::class);
         $cacheProphecy = $this->prophesize(FrontendInterface::class);
-        $cacheManagerProphecy->getCache('cache_runtime')->willReturn($cacheProphecy->reveal());
+        $cacheManagerProphecy->getCache('runtime')->willReturn($cacheProphecy->reveal());
         $cacheProphecy->get(Argument::cetera())->willReturn(false);
         $cacheProphecy->set(Argument::cetera())->willReturn(false);
         GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManagerProphecy->reveal());
index 4ffd091..94e4d50 100644 (file)
@@ -65,8 +65,8 @@ class AbstractConditionMatcherTest extends UnitTestCase
         $cacheFrontendProphecy->set(Argument::any(), Argument::any())->willReturn(null);
         $cacheFrontendProphecy->get('backendUtilityBeGetRootLine')->willReturn([]);
         $cacheManagerProphecy = $this->prophesize(CacheManager::class);
-        $cacheManagerProphecy->getCache('cache_core')->willReturn($cacheFrontendProphecy->reveal());
-        $cacheManagerProphecy->getCache('cache_runtime')->willReturn($cacheFrontendProphecy->reveal());
+        $cacheManagerProphecy->getCache('core')->willReturn($cacheFrontendProphecy->reveal());
+        $cacheManagerProphecy->getCache('runtime')->willReturn($cacheFrontendProphecy->reveal());
         GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManagerProphecy->reveal());
 
         $packageManagerProphecy = $this->prophesize(PackageManager::class);
index e7e2422..0c63eda 100644 (file)
@@ -63,7 +63,7 @@ class DataHandlerTest extends UnitTestCase
         $cacheManagerProphecy = $this->prophesize(CacheManager::class);
         GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManagerProphecy->reveal());
         $cacheFrontendProphecy = $this->prophesize(FrontendInterface::class);
-        $cacheManagerProphecy->getCache('cache_runtime')->willReturn($cacheFrontendProphecy->reveal());
+        $cacheManagerProphecy->getCache('runtime')->willReturn($cacheFrontendProphecy->reveal());
         $this->backEndUser = $this->createMock(BackendUserAuthentication::class);
         $this->subject = $this->getAccessibleMock(DataHandler::class, ['dummy']);
         $this->subject->start([], '', $this->backEndUser);
index f388419..9d075e9 100644 (file)
@@ -42,7 +42,7 @@ class ResolverTest extends UnitTestCase
         $cacheFrontendProphecy->has(Argument::any())->willReturn(false);
         $cacheFrontendProphecy->set(Argument::any(), Argument::any())->willReturn(null);
         $cacheManagerProphecy = $this->prophesize(CacheManager::class);
-        $cacheManagerProphecy->getCache('cache_core')->willReturn($cacheFrontendProphecy->reveal());
+        $cacheManagerProphecy->getCache('core')->willReturn($cacheFrontendProphecy->reveal());
         GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManagerProphecy->reveal());
 
         $packageManagerProphecy = $this->prophesize(PackageManager::class);
index 0a0c4d1..6d53904 100644 (file)
@@ -63,7 +63,7 @@ class ResourceStorageTest extends BaseTestCase
         );
         $cacheManagerProphecy = $this->prophesize(CacheManager::class);
         $cacheProphecy = $this->prophesize(FrontendInterface::class);
-        $cacheManagerProphecy->getCache('cache_runtime')->willReturn($cacheProphecy->reveal());
+        $cacheManagerProphecy->getCache('runtime')->willReturn($cacheProphecy->reveal());
         $cacheProphecy->get(Argument::cetera())->willReturn(false);
         $cacheProphecy->set(Argument::cetera())->willReturn(false);
         GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManagerProphecy->reveal());
index e90e740..49ea79e 100644 (file)
@@ -454,7 +454,7 @@ class TypoScriptParserTest extends UnitTestCase
         // This test triggers an BackendUtility::BEgetRootLine() down below, we need to suppress the cache call
         $cacheManagerProphecy = $this->prophesize(CacheManager::class);
         $cacheProphecy = $this->prophesize(FrontendInterface::class);
-        $cacheManagerProphecy->getCache('cache_runtime')->willReturn($cacheProphecy->reveal());
+        $cacheManagerProphecy->getCache('runtime')->willReturn($cacheProphecy->reveal());
         $cacheProphecy->get(Argument::cetera())->willReturn(false);
         $cacheProphecy->set(Argument::cetera())->willReturn(false);
         GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManagerProphecy->reveal());
index 49536a6..45e0f8d 100644 (file)
@@ -4372,7 +4372,7 @@ class GeneralUtilityTest extends UnitTestCase
     {
         $cacheManagerProphecy = $this->prophesize(CacheManager::class);
         $cacheProphecy = $this->prophesize(FrontendInterface::class);
-        $cacheManagerProphecy->getCache('cache_runtime')->willReturn($cacheProphecy->reveal());
+        $cacheManagerProphecy->getCache('runtime')->willReturn($cacheProphecy->reveal());
         $cacheProphecy->get('generalUtilityXml2Array')->shouldBeCalled()->willReturn(false);
         $cacheProphecy->set('generalUtilityXml2Array', Argument::cetera())->shouldBeCalled();
         GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManagerProphecy->reveal());
@@ -4434,7 +4434,7 @@ class GeneralUtilityTest extends UnitTestCase
     {
         $cacheManagerProphecy = $this->prophesize(CacheManager::class);
         $cacheProphecy = $this->prophesize(FrontendInterface::class);
-        $cacheManagerProphecy->getCache('cache_runtime')->willReturn($cacheProphecy->reveal());
+        $cacheManagerProphecy->getCache('runtime')->willReturn($cacheProphecy->reveal());
         $cacheProphecy->get('generalUtilityXml2Array')->shouldBeCalled()->willReturn(false);
         $cacheProphecy->set('generalUtilityXml2Array', Argument::cetera())->shouldBeCalled();
         GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManagerProphecy->reveal());
@@ -4500,7 +4500,7 @@ class GeneralUtilityTest extends UnitTestCase
     {
         $cacheManagerProphecy = $this->prophesize(CacheManager::class);
         $cacheProphecy = $this->prophesize(FrontendInterface::class);
-        $cacheManagerProphecy->getCache('cache_runtime')->willReturn($cacheProphecy->reveal());
+        $cacheManagerProphecy->getCache('runtime')->willReturn($cacheProphecy->reveal());
         $cacheProphecy->get('generalUtilityXml2Array')->shouldBeCalled()->willReturn(false);
         $cacheProphecy->set('generalUtilityXml2Array', Argument::cetera())->shouldBeCalled();
         GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManagerProphecy->reveal());
@@ -4556,7 +4556,7 @@ class GeneralUtilityTest extends UnitTestCase
     {
         $cacheManagerProphecy = $this->prophesize(CacheManager::class);
         $cacheProphecy = $this->prophesize(FrontendInterface::class);
-        $cacheManagerProphecy->getCache('cache_runtime')->willReturn($cacheProphecy->reveal());
+        $cacheManagerProphecy->getCache('runtime')->willReturn($cacheProphecy->reveal());
         $cacheProphecy->get('generalUtilityXml2Array')->shouldBeCalled()->willReturn(false);
         $cacheProphecy->set('generalUtilityXml2Array', Argument::cetera())->shouldBeCalled();
         GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManagerProphecy->reveal());
@@ -4583,7 +4583,7 @@ class GeneralUtilityTest extends UnitTestCase
     {
         $cacheManagerProphecy = $this->prophesize(CacheManager::class);
         $cacheProphecy = $this->prophesize(FrontendInterface::class);
-        $cacheManagerProphecy->getCache('cache_runtime')->willReturn($cacheProphecy->reveal());
+        $cacheManagerProphecy->getCache('runtime')->willReturn($cacheProphecy->reveal());
         $cacheProphecy->get('generalUtilityXml2Array')->shouldBeCalled()->willReturn(false);
         $cacheProphecy->set('generalUtilityXml2Array', Argument::cetera())->shouldBeCalled();
         GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManagerProphecy->reveal());
@@ -4683,7 +4683,7 @@ class GeneralUtilityTest extends UnitTestCase
     {
         $cacheManagerProphecy = $this->prophesize(CacheManager::class);
         $cacheProphecy = $this->prophesize(FrontendInterface::class);
-        $cacheManagerProphecy->getCache('cache_runtime')->willReturn($cacheProphecy->reveal());
+        $cacheManagerProphecy->getCache('runtime')->willReturn($cacheProphecy->reveal());
         $cacheProphecy->get('generalUtilityXml2Array')->shouldBeCalled()->willReturn(false);
         $cacheProphecy->set('generalUtilityXml2Array', Argument::cetera())->shouldBeCalled();
         GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManagerProphecy->reveal());
index 92f1fb8..60ad06c 100644 (file)
@@ -48,7 +48,7 @@ class RootlineUtilityTest extends UnitTestCase
         $cacheManagerProphecy = $this->prophesize(CacheManager::class);
         GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManagerProphecy->reveal());
         $cacheFrontendProphecy = $this->prophesize(FrontendInterface::class);
-        $cacheManagerProphecy->getCache('cache_rootline')->willReturn($cacheFrontendProphecy->reveal());
+        $cacheManagerProphecy->getCache('rootline')->willReturn($cacheFrontendProphecy->reveal());
 
         $this->subject = $this->getAccessibleMock(
             RootlineUtility::class,
index ecc7ffe..1faf220 100644 (file)
@@ -51,7 +51,7 @@
                "friendsofphp/php-cs-fixer": "^2.12.2",
                "phpspec/prophecy": "^1.7.5",
                "typo3/cms-styleguide": "~10.0.2",
-               "typo3/testing-framework": "~5.0.7"
+               "typo3/testing-framework": "~5.0.9"
        },
        "suggest": {
                "ext-fileinfo": "Used for proper file type detection in the file abstraction layer",
index cb16f10..8149be0 100644 (file)
@@ -156,7 +156,7 @@ abstract class AbstractRenderable implements RenderableInterface, VariableRender
         }
 
         if (isset($options['validators'])) {
-            $runtimeCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_runtime');
+            $runtimeCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('runtime');
             $configurationHashes = $runtimeCache->get('formAbstractRenderableConfigurationHashes') ?: [];
 
             if ($resetValidators) {
index 4f39312..dce7f04 100644 (file)
@@ -119,7 +119,7 @@ class FormPersistenceManager implements FormPersistenceManagerInterface
         $this->formSettings = GeneralUtility::makeInstance(ObjectManager::class)
             ->get(ConfigurationManagerInterface::class)
             ->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_YAML_SETTINGS, 'form');
-        $this->runtimeCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_runtime');
+        $this->runtimeCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('runtime');
     }
 
     /**
index 10f7663..361aa97 100644 (file)
@@ -37,7 +37,7 @@ class FormFrontendControllerTest extends UnitTestCase
         $cacheManagerProphecy = $this->prophesize(CacheManager::class);
         GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManagerProphecy->reveal());
         $cacheFrontendProphecy = $this->prophesize(FrontendInterface::class);
-        $cacheManagerProphecy->getCache('cache_runtime')->willReturn($cacheFrontendProphecy->reveal());
+        $cacheManagerProphecy->getCache('runtime')->willReturn($cacheFrontendProphecy->reveal());
         $cacheFrontendProphecy->get(Argument::cetera())->willReturn(false);
         $cacheFrontendProphecy->set(Argument::cetera())->willReturn(null);
     }
index 73253d1..3a10eac 100644 (file)
@@ -43,7 +43,7 @@ class DataStructureIdentifierHookTest extends UnitTestCase
         parent::setUp();
         $cacheManagerProphecy = $this->prophesize(CacheManager::class);
         $cacheProphecy = $this->prophesize(FrontendInterface::class);
-        $cacheManagerProphecy->getCache('cache_runtime')->willReturn($cacheProphecy->reveal());
+        $cacheManagerProphecy->getCache('runtime')->willReturn($cacheProphecy->reveal());
         $cacheProphecy->get(Argument::cetera())->willReturn(false);
         $cacheProphecy->set(Argument::cetera())->willReturn(false);
         GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManagerProphecy->reveal());
index 574177f..1c843ee 100644 (file)
@@ -820,7 +820,7 @@ class ContentObjectRenderer implements LoggerAwareInterface
             $key = $this->calculateCacheKey($cacheConfiguration);
             if (!empty($key)) {
                 /** @var \TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $cacheFrontend */
-                $cacheFrontend = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_hash');
+                $cacheFrontend = GeneralUtility::makeInstance(CacheManager::class)->getCache('hash');
                 $tags = $this->calculateCacheTags($cacheConfiguration);
                 $lifetime = $this->calculateCacheLifetime($cacheConfiguration);
                 $cacheFrontend->set($key, $content, $tags, $lifetime);
@@ -2876,7 +2876,7 @@ class ContentObjectRenderer implements LoggerAwareInterface
             return $content;
         }
         /** @var \TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $cacheFrontend */
-        $cacheFrontend = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_hash');
+        $cacheFrontend = GeneralUtility::makeInstance(CacheManager::class)->getCache('hash');
         $tags = $this->calculateCacheTags($conf['cache.']);
         $lifetime = $this->calculateCacheLifetime($conf['cache.']);
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['stdWrap_cacheStore'] ?? [] as $_funcRef) {
@@ -6968,7 +6968,7 @@ class ContentObjectRenderer implements LoggerAwareInterface
         if (!empty($cacheKey)) {
             /** @var \TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $cacheFrontend */
             $cacheFrontend = GeneralUtility::makeInstance(CacheManager::class)
-                ->getCache('cache_hash');
+                ->getCache('hash');
             $content = $cacheFrontend->get($cacheKey);
         }
         return $content;
index d4dff40..f182995 100644 (file)
@@ -2146,7 +2146,7 @@ abstract class AbstractMenuContentObject
      */
     protected function getCache()
     {
-        return GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_hash');
+        return GeneralUtility::makeInstance(CacheManager::class)->getCache('hash');
     }
 
     /**
@@ -2154,7 +2154,7 @@ abstract class AbstractMenuContentObject
      */
     protected function getRuntimeCache()
     {
-        return GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_runtime');
+        return GeneralUtility::makeInstance(CacheManager::class)->getCache('runtime');
     }
 
     /**
index 58cc3e3..15c992e 100644 (file)
@@ -708,7 +708,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface
      */
     protected function initCaches()
     {
-        $this->pageCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_pages');
+        $this->pageCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('pages');
     }
 
     /**
@@ -3254,7 +3254,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface
             $TSdataArray = TypoScriptParser::checkIncludeLines_array($TSdataArray);
             $userTS = implode(LF . '[GLOBAL]' . LF, $TSdataArray);
             $identifier = md5('pageTS:' . $userTS);
-            $contentHashCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_hash');
+            $contentHashCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('hash');
             $this->pagesTSconfig = $contentHashCache->get($identifier);
             if (!is_array($this->pagesTSconfig)) {
                 $parseObj = GeneralUtility::makeInstance(TypoScriptParser::class);
@@ -3363,7 +3363,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface
     public function get_cache_timeout()
     {
         /** @var \TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend $runtimeCache */
-        $runtimeCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_runtime');
+        $runtimeCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('runtime');
         $cachedCacheLifetimeIdentifier = 'core-tslib_fe-get_cache_timeout';
         $cachedCacheLifetime = $runtimeCache->get($cachedCacheLifetimeIdentifier);
         if ($cachedCacheLifetime === false) {
index ffe6273..70bec45 100644 (file)
@@ -1736,6 +1736,6 @@ class PageRepository implements LoggerAwareInterface
      */
     protected function getRuntimeCache(): VariableFrontend
     {
-        return GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_runtime');
+        return GeneralUtility::makeInstance(CacheManager::class)->getCache('runtime');
     }
 }
index 76ee01c..e8b083c 100644 (file)
@@ -484,7 +484,7 @@ class PageLinkBuilder extends AbstractTypolinkBuilder
      */
     protected function initializeMountPointMap(string $defaultMountPoints = null, string $mapRootPointList = null): array
     {
-        $runtimeCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_runtime');
+        $runtimeCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('runtime');
         $mountPointMap = $runtimeCache->get('pageLinkBuilderMountPointMap') ?: [];
         if (!empty($mountPointMap) || (empty($mapRootPointList) && empty($defaultMountPoints))) {
             return $mountPointMap;
index 95a2a34..7f64af3 100644 (file)
@@ -201,7 +201,7 @@ class ContentObjectRendererTest extends UnitTestCase
     {
         $cacheManagerProphecy = $this->prophesize(CacheManager::class);
         $cacheProphecy = $this->prophesize(CacheFrontendInterface::class);
-        $cacheManagerProphecy->getCache('cache_imagesizes')->willReturn($cacheProphecy->reveal());
+        $cacheManagerProphecy->getCache('imagesizes')->willReturn($cacheProphecy->reveal());
         $cacheProphecy->get(Argument::cetera())->willReturn(false);
         $cacheProphecy->set(Argument::cetera(), null)->willReturn(false);
         GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManagerProphecy->reveal());
index db26f8b..b94278a 100644 (file)
@@ -490,7 +490,7 @@ class TypoScriptFrontendControllerTest extends UnitTestCase
 
         $nullCacheBackend = new NullBackend('');
         $cacheManager = $this->prophesize(CacheManager::class);
-        $cacheManager->getCache('cache_pages')->willReturn($nullCacheBackend);
+        $cacheManager->getCache('pages')->willReturn($nullCacheBackend);
         GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManager->reveal());
 
         $subject = new TypoScriptFrontendController(null, 1, 0);
index ec8227b..bbe41fc 100644 (file)
@@ -737,7 +737,7 @@ class AdministrationRepository
 
                 if (!empty($idList)) {
                     /** @var FrontendInterface $pageCache */
-                    $pageCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_pages');
+                    $pageCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('pages');
                     foreach ($idList as $pageId) {
                         $pageCache->flushByTag('pageId_' . $pageId);
                     }
index 1a1ce92..63a830c 100644 (file)
@@ -172,6 +172,7 @@ class SilentConfigurationUpgradeService
         $this->migrateExceptionErrors();
         $this->migrateDisplayErrorsSetting();
         $this->migrateSaltedPasswordsSettings();
+        $this->migrateCachingFrameworkCaches();
 
         // Should run at the end to prevent obsolete settings are removed before migration
         $this->removeObsoleteLocalConfigurationSettings();
@@ -1039,4 +1040,32 @@ class SilentConfigurationUpgradeService
         $confManager->removeLocalConfigurationKeysByPath($configsToRemove);
         $this->throwConfigurationChangedException();
     }
+
+    /**
+     * Renames all SYS[caching][cache] configuration names to names without the prefix "cache_".
+     * see #88366
+     */
+    protected function migrateCachingFrameworkCaches()
+    {
+        $confManager = $this->configurationManager;
+        try {
+            $cacheConfigurations = (array)$confManager->getLocalConfigurationValueByPath('SYS/caching/cacheConfigurations');
+            $newConfig = [];
+            $hasBeenModified = false;
+            foreach ($cacheConfigurations as $identifier => $cacheConfiguration) {
+                if (strpos($identifier, 'cache_') === 0) {
+                    $identifier = substr($identifier, 6);
+                    $hasBeenModified = true;
+                }
+                $newConfig[$identifier] = $cacheConfiguration;
+            }
+
+            if ($hasBeenModified) {
+                $confManager->setLocalConfigurationValueByPath('SYS/caching/cacheConfigurations', $newConfig);
+                $this->throwConfigurationChangedException();
+            }
+        } catch (MissingArrayPathException $e) {
+            // no change inside the LocalConfiguration.php found, so nothing needs to be modified
+        }
+    }
 }
index a80017e..986b98d 100644 (file)
@@ -954,4 +954,104 @@ class SilentConfigurationUpgradeServiceTest extends UnitTestCase
         $this->expectExceptionCode(1379024938);
         $silentConfigurationUpgradeService->_call('migrateSaltedPasswordsSettings');
     }
+
+    /**
+     * @test
+     */
+    public function migrateCachingFrameworkCachesMigratesData()
+    {
+        $oldCacheConfigurations = [
+            'cache_rootline' => [
+                'frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class,
+                'backend' => \TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend::class,
+                'options' => [
+                    'defaultLifetime' => 2592000,
+                ],
+                'groups' => ['pages']
+            ],
+            'fluid_template' => [
+                'backend' => \TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend::class,
+                'frontend' => \TYPO3\CMS\Fluid\Core\Cache\FluidTemplateCache::class,
+                'groups' => ['system'],
+            ],
+        ];
+        $newCacheConfigurations = [
+            'rootline' => [
+                'frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class,
+                'backend' => \TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend::class,
+                'options' => [
+                    'defaultLifetime' => 2592000,
+                ],
+                'groups' => ['pages']
+            ],
+            'fluid_template' => [
+                'backend' => \TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend::class,
+                'frontend' => \TYPO3\CMS\Fluid\Core\Cache\FluidTemplateCache::class,
+                'groups' => ['system'],
+            ],
+        ];
+        /** @var ConfigurationManager|ObjectProphecy $configurationManager */
+        $configurationManager = $this->prophesize(ConfigurationManager::class);
+        $configurationManager->getLocalConfigurationValueByPath('SYS/caching/cacheConfigurations')
+            ->shouldBeCalled()
+            ->willReturn($oldCacheConfigurations);
+
+        $configurationManager->setLocalConfigurationValueByPath('SYS/caching/cacheConfigurations', $newCacheConfigurations)->shouldBeCalled();
+
+        $this->expectException(ConfigurationChangedException::class);
+        $this->expectExceptionCode(1379024938);
+
+        /** @var $silentConfigurationUpgradeServiceInstance SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface */
+        $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
+            SilentConfigurationUpgradeService::class,
+            ['dummy'],
+            [],
+            '',
+            false
+        );
+
+        $silentConfigurationUpgradeServiceInstance->_set('configurationManager', $configurationManager->reveal());
+        $silentConfigurationUpgradeServiceInstance->_call('migrateCachingFrameworkCaches');
+    }
+
+    /**
+     * @test
+     */
+    public function migrateCachingFrameworkCachesDoesNotMigrateWithoutPrefix()
+    {
+        $oldCacheConfigurations = [
+            'rootline' => [
+                'frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class,
+                'backend' => \TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend::class,
+                'options' => [
+                    'defaultLifetime' => 2592000,
+                ],
+                'groups' => ['pages']
+            ],
+            'fluid_template' => [
+                'backend' => \TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend::class,
+                'frontend' => \TYPO3\CMS\Fluid\Core\Cache\FluidTemplateCache::class,
+                'groups' => ['system'],
+            ],
+        ];
+        /** @var ConfigurationManager|ObjectProphecy $configurationManager */
+        $configurationManager = $this->prophesize(ConfigurationManager::class);
+        $configurationManager->getLocalConfigurationValueByPath('SYS/caching/cacheConfigurations')
+            ->shouldBeCalled()
+            ->willReturn($oldCacheConfigurations);
+
+        $configurationManager->setLocalConfigurationValueByPath(Argument::cetera())->shouldNotBeCalled();
+
+        /** @var $silentConfigurationUpgradeServiceInstance SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface */
+        $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
+            SilentConfigurationUpgradeService::class,
+            ['dummy'],
+            [],
+            '',
+            false
+        );
+
+        $silentConfigurationUpgradeServiceInstance->_set('configurationManager', $configurationManager->reveal());
+        $silentConfigurationUpgradeServiceInstance->_call('migrateCachingFrameworkCaches');
+    }
 }
index 3c054ff..ffbb3a5 100644 (file)
@@ -224,7 +224,7 @@ class ConfigurationController
                 MiddlewareStackResolver::class,
                 GeneralUtility::makeInstance(PackageManager::class),
                 GeneralUtility::makeInstance(DependencyOrderingService::class),
-                GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_core')
+                GeneralUtility::makeInstance(CacheManager::class)->getCache('core')
             );
             $renderArray = [];
             foreach (['frontend', 'backend'] as $stackName) {
index 89f4e86..dd602d5 100644 (file)
@@ -3947,7 +3947,7 @@ class DatabaseRecordList
      */
     protected function getSearchableWebmounts($id, $depth, $perms_clause)
     {
-        $runtimeCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_runtime');
+        $runtimeCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('runtime');
         $hash = 'webmounts_list' . md5($id . '-' . $depth . '-' . $perms_clause);
         if ($runtimeCache->has($hash)) {
             $idList = $runtimeCache->get($hash);
index b7411c3..9df6b7f 100644 (file)
@@ -208,6 +208,6 @@ class DeletedRecordsController
      */
     protected function getMemoryCache()
     {
-        return $this->getCacheManager()->getCache('cache_runtime');
+        return $this->getCacheManager()->getCache('runtime');
     }
 }
index 4a5511e..87643d3 100644 (file)
@@ -558,7 +558,7 @@ class DeletedRecords
      */
     protected function getCache(): FrontendInterface
     {
-        return GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_runtime');
+        return GeneralUtility::makeInstance(CacheManager::class)->getCache('runtime');
     }
 
     /**
index 9e563b1..8d2ac28 100644 (file)
@@ -42,7 +42,7 @@ class RedirectCacheService
     public function __construct(CacheManager $cacheManager = null)
     {
         $cacheManager = $cacheManager ?? GeneralUtility::makeInstance(CacheManager::class);
-        $this->cache = $cacheManager->getCache('cache_pages');
+        $this->cache = $cacheManager->getCache('pages');
     }
 
     /**