From 8132080674708e1fb323d3335aaa4d2b8bc019db Mon Sep 17 00:00:00 2001 From: Rafael Kassner Date: Fri, 26 Mar 2021 10:15:32 +0100 Subject: [PATCH] Separate cache_types from app/etc/config.php --- lib/internal/Magento/Framework/App/Cache/State.php | 2 +- lib/internal/Magento/Framework/Config/File/ConfigFilePool.php | 2 ++ .../Framework/Config/Test/Unit/File/ConfigFilePoolTest.php | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/App/Cache/State.php b/lib/internal/Magento/Framework/App/Cache/State.php index 9d268ac2d1bb7..ef639a74540f4 100644 --- a/lib/internal/Magento/Framework/App/Cache/State.php +++ b/lib/internal/Magento/Framework/App/Cache/State.php @@ -101,7 +101,7 @@ public function setEnabled($cacheType, $isEnabled) public function persist() { $this->load(); - $this->writer->saveConfig([ConfigFilePool::APP_ENV => [self::CACHE_KEY => $this->statuses]]); + $this->writer->saveConfig([ConfigFilePool::APP_CACHE => [self::CACHE_KEY => $this->statuses]]); } /** diff --git a/lib/internal/Magento/Framework/Config/File/ConfigFilePool.php b/lib/internal/Magento/Framework/Config/File/ConfigFilePool.php index c9fa5e3ddc606..589e281920dd0 100644 --- a/lib/internal/Magento/Framework/Config/File/ConfigFilePool.php +++ b/lib/internal/Magento/Framework/Config/File/ConfigFilePool.php @@ -13,6 +13,7 @@ */ class ConfigFilePool { + const APP_CACHE = 'app_cache'; const APP_CONFIG = 'app_config'; const APP_ENV = 'app_env'; @@ -32,6 +33,7 @@ class ConfigFilePool * @var array */ private $applicationConfigFiles = [ + self::APP_CACHE => 'cache.php', self::APP_CONFIG => 'config.php', self::APP_ENV => 'env.php', ]; diff --git a/lib/internal/Magento/Framework/Config/Test/Unit/File/ConfigFilePoolTest.php b/lib/internal/Magento/Framework/Config/Test/Unit/File/ConfigFilePoolTest.php index 7354d0ef190ae..b7d177d9a4136 100644 --- a/lib/internal/Magento/Framework/Config/Test/Unit/File/ConfigFilePoolTest.php +++ b/lib/internal/Magento/Framework/Config/Test/Unit/File/ConfigFilePoolTest.php @@ -29,6 +29,7 @@ protected function setUp(): void public function testGetPaths() { $expected['new_key'] = 'new_config.php'; + $expected[ConfigFilePool::APP_CACHE] = 'cache.php'; $expected[ConfigFilePool::APP_CONFIG] = 'config.php'; $expected[ConfigFilePool::APP_ENV] = 'env.php';