7
7
8
8
use Magento \Framework \App \Config \ConfigTypeInterface ;
9
9
use Magento \Framework \App \Config \ConfigSourceInterface ;
10
- use Magento \Framework \Cache \FrontendInterface ;
11
10
use Magento \Framework \DataObject ;
12
- use Magento \Framework \Serialize \Serializer \Serialize ;
13
- use Magento \Framework \Serialize \SerializerInterface ;
14
- use Magento \Store \Model \Group ;
15
- use Magento \Store \Model \Store ;
16
- use Magento \Store \Model \Website ;
17
11
18
12
/**
19
13
* Merge and hold scopes data from different sources
@@ -34,38 +28,14 @@ class Scopes implements ConfigTypeInterface
34
28
*/
35
29
private $ data ;
36
30
37
- /**
38
- * @var FrontendInterface
39
- */
40
- private $ cache ;
41
-
42
- /**
43
- * @var int
44
- */
45
- private $ cachingNestedLevel ;
46
-
47
- /**
48
- * @var Serialize
49
- */
50
- private $ serializer ;
51
-
52
31
/**
53
32
* System constructor.
54
33
* @param ConfigSourceInterface $source
55
- * @param FrontendInterface $cache
56
- * @param int $cachingNestedLevel
57
- * @param SerializerInterface $serializer
58
34
*/
59
35
public function __construct (
60
- ConfigSourceInterface $ source ,
61
- FrontendInterface $ cache ,
62
- Serialize $ serializer ,
63
- $ cachingNestedLevel = 1
36
+ ConfigSourceInterface $ source
64
37
) {
65
38
$ this ->source = $ source ;
66
- $ this ->cache = $ cache ;
67
- $ this ->cachingNestedLevel = $ cachingNestedLevel ;
68
- $ this ->serializer = $ serializer ;
69
39
}
70
40
71
41
/**
@@ -74,18 +44,7 @@ public function __construct(
74
44
public function get ($ path = '' )
75
45
{
76
46
if (!$ this ->data ) {
77
- /** @var DataObject $data */
78
- $ data = $ this ->cache ->load (self ::CONFIG_TYPE );
79
- if (!$ data ) {
80
- $ this ->data = new DataObject ($ this ->source ->get ());
81
- $ this ->cache ->save (
82
- $ this ->serializer ->serialize ($ this ->data ->getData ()),
83
- self ::CONFIG_TYPE ,
84
- [Group::CACHE_TAG , Store::CACHE_TAG , Website::CACHE_TAG ]
85
- );
86
- } else {
87
- $ this ->data = new DataObject ($ this ->serializer ->unserialize ($ data ));
88
- }
47
+ $ this ->data = new DataObject ($ this ->source ->get ());
89
48
}
90
49
91
50
return $ this ->data ->getData ($ path );
@@ -99,9 +58,5 @@ public function get($path = '')
99
58
public function clean ()
100
59
{
101
60
$ this ->data = null ;
102
- $ this ->cache ->clean (
103
- \Zend_Cache::CLEANING_MODE_MATCHING_TAG ,
104
- [Group::CACHE_TAG , Store::CACHE_TAG , Website::CACHE_TAG ]
105
- );
106
61
}
107
62
}
0 commit comments