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 \Store \Model \Group ;
13
- use Magento \Store \Model \Store ;
14
- use Magento \Store \Model \Website ;
15
11
16
12
/**
17
13
* Merge and hold scopes data from different sources
@@ -32,30 +28,14 @@ class Scopes implements ConfigTypeInterface
32
28
*/
33
29
private $ data ;
34
30
35
- /**
36
- * @var FrontendInterface
37
- */
38
- private $ cache ;
39
-
40
- /**
41
- * @var int
42
- */
43
- private $ cachingNestedLevel ;
44
-
45
31
/**
46
32
* System constructor.
47
33
* @param ConfigSourceInterface $source
48
- * @param FrontendInterface $cache
49
- * @param int $cachingNestedLevel
50
34
*/
51
35
public function __construct (
52
- ConfigSourceInterface $ source ,
53
- FrontendInterface $ cache ,
54
- $ cachingNestedLevel = 1
36
+ ConfigSourceInterface $ source
55
37
) {
56
38
$ this ->source = $ source ;
57
- $ this ->cache = $ cache ;
58
- $ this ->cachingNestedLevel = $ cachingNestedLevel ;
59
39
}
60
40
61
41
/**
@@ -64,18 +44,7 @@ public function __construct(
64
44
public function get ($ path = '' )
65
45
{
66
46
if (!$ this ->data ) {
67
- /** @var DataObject $data */
68
- $ data = $ this ->cache ->load (self ::CONFIG_TYPE );
69
- if (!$ data ) {
70
- $ this ->data = new DataObject ($ this ->source ->get ());
71
- $ this ->cache ->save (
72
- serialize ($ this ->data ),
73
- self ::CONFIG_TYPE ,
74
- [Group::CACHE_TAG , Store::CACHE_TAG , Website::CACHE_TAG ]
75
- );
76
- } else {
77
- $ this ->data = unserialize ($ data );
78
- }
47
+ $ this ->data = new DataObject ($ this ->source ->get ());
79
48
}
80
49
81
50
return $ this ->data ->getData ($ path );
@@ -89,9 +58,5 @@ public function get($path = '')
89
58
public function clean ()
90
59
{
91
60
$ this ->data = null ;
92
- $ this ->cache ->clean (
93
- \Zend_Cache::CLEANING_MODE_MATCHING_TAG ,
94
- [Group::CACHE_TAG , Store::CACHE_TAG , Website::CACHE_TAG ]
95
- );
96
61
}
97
62
}
0 commit comments