[TASK] Use own php code cache in ext:dbal 83/49583/3
authorChristian Kuhn <lolli@schwarzbu.ch>
Wed, 24 Aug 2016 21:06:36 +0000 (23:06 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 30 Aug 2016 18:53:40 +0000 (20:53 +0200)
Switch from using core cache "cache_phpcode" to
an own cache named "dbal_phpcode" in ext:dbal.

Change-Id: I71920dba95d2578f9662c5f736e18bbac3e5dcf5
Resolves: #77626
Releases: master
Reviewed-on: https://review.typo3.org/49583
Tested-by: Bamboo TYPO3com <info@typo3.com>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/dbal/Classes/Database/DatabaseConnection.php
typo3/sysext/dbal/ext_localconf.php

index 613e34f..2b15311 100644 (file)
@@ -270,7 +270,7 @@ class DatabaseConnection extends \TYPO3\CMS\Core\Database\DatabaseConnection
      */
     protected function getFieldInfoCache()
     {
-        return GeneralUtility::makeInstance(\TYPO3\CMS\Core\Cache\CacheManager::class)->getCache('cache_phpcode');
+        return GeneralUtility::makeInstance(\TYPO3\CMS\Core\Cache\CacheManager::class)->getCache('dbal_phpcode');
     }
 
     /**
index 9552562..3181d22 100644 (file)
@@ -1,7 +1,10 @@
 <?php
 defined('TYPO3_MODE') or die();
 
-$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Core\Database\DatabaseConnection::class] = ['className' => \TYPO3\CMS\Dbal\Database\DatabaseConnection::class];
+// Main xclass
+$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Core\Database\DatabaseConnection::class] = [
+    'className' => \TYPO3\CMS\Dbal\Database\DatabaseConnection::class
+];
 
 // Register caches if not already done in localconf.php or a previously loaded extension.
 if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['dbal'])) {
@@ -10,3 +13,13 @@ if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations
         'groups' => []
     ];
 }
+if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['dbal_phpcode'])) {
+    $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['dbal_phpcode'] = [
+        'frontend' => \TYPO3\CMS\Core\Cache\Frontend\PhpFrontend::class,
+        'backend' => \TYPO3\CMS\Core\Cache\Backend\FileBackend::class,
+        'options' => [
+            'defaultLifetime' => 0,
+        ],
+        'groups' => ['system']
+    ];
+}