@@ -59,21 +59,21 @@ class System implements ConfigTypeInterface
59
59
private $ serializer ;
60
60
61
61
/**
62
- * Key name for flag which displays whether configuration is cached or not.
63
- *
64
- * Once configuration is cached additional flag pushed to cache storage
65
- * to be able check cache existence without data load.
62
+ * The type of config.
66
63
*
67
64
* @var string
68
65
*/
69
- private $ cacheExistenceKey = self :: CONFIG_TYPE . ' _CACHE_EXISTS ' ;
66
+ private $ configType ;
70
67
71
68
/**
72
- * The type of config.
69
+ * Key name for flag which displays whether configuration is cached or not.
70
+ *
71
+ * Once configuration is cached additional flag pushed to cache storage
72
+ * to be able check cache existence without data load.
73
73
*
74
74
* @var string
75
75
*/
76
- private $ configType ;
76
+ private $ cacheExistenceKey ;
77
77
78
78
/**
79
79
* @param \Magento\Framework\App\Config\ConfigSourceInterface $source
@@ -103,6 +103,7 @@ public function __construct(
103
103
$ this ->fallback = $ fallback ;
104
104
$ this ->serializer = $ serializer ;
105
105
$ this ->configType = $ configType ;
106
+ $ this ->cacheExistenceKey = $ this ->configType . '_CACHE_EXISTS ' ;
106
107
}
107
108
108
109
/**
@@ -209,8 +210,8 @@ private function cacheConfig($data)
209
210
foreach ($ data as $ scope => $ scopeData ) {
210
211
foreach ($ scopeData as $ key => $ config ) {
211
212
$ this ->cache ->save (
212
- $ this ->serializer ->serialize ($ this -> data -> getData () ),
213
- self :: CONFIG_TYPE ,
213
+ $ this ->serializer ->serialize ($ config ),
214
+ $ this -> configType . ' _ ' . $ scope . $ key ,
214
215
[self ::CACHE_TAG ]
215
216
);
216
217
}
@@ -237,7 +238,7 @@ private function readFromCache($path)
237
238
$ result = null ;
238
239
$ pathParts = $ this ->getPathParts ($ path );
239
240
if (!empty ($ pathParts )) {
240
- $ result = $ this ->cache ->load (self :: CONFIG_TYPE . '_ ' . $ pathParts [0 ] . $ pathParts [1 ]);
241
+ $ result = $ this ->cache ->load ($ this -> configType . '_ ' . $ pathParts [0 ] . $ pathParts [1 ]);
241
242
if ($ result !== false ) {
242
243
$ readData = $ this ->data ->getData ();
243
244
$ readData [$ pathParts [0 ]][$ pathParts [1 ]] = $ this ->serializer ->unserialize ($ result );
0 commit comments