77
88use Magento \Framework \App \Config \ConfigTypeInterface ;
99use Magento \Framework \App \Config \ConfigSourceInterface ;
10- use Magento \Framework \Cache \FrontendInterface ;
1110use 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 ;
1711
1812/**
1913 * Merge and hold scopes data from different sources
@@ -34,38 +28,14 @@ class Scopes implements ConfigTypeInterface
3428 */
3529 private $ data ;
3630
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-
5231 /**
5332 * System constructor.
5433 * @param ConfigSourceInterface $source
55- * @param FrontendInterface $cache
56- * @param int $cachingNestedLevel
57- * @param SerializerInterface $serializer
5834 */
5935 public function __construct (
60- ConfigSourceInterface $ source ,
61- FrontendInterface $ cache ,
62- Serialize $ serializer ,
63- $ cachingNestedLevel = 1
36+ ConfigSourceInterface $ source
6437 ) {
6538 $ this ->source = $ source ;
66- $ this ->cache = $ cache ;
67- $ this ->cachingNestedLevel = $ cachingNestedLevel ;
68- $ this ->serializer = $ serializer ;
6939 }
7040
7141 /**
@@ -74,18 +44,7 @@ public function __construct(
7444 public function get ($ path = '' )
7545 {
7646 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 ());
8948 }
9049
9150 return $ this ->data ->getData ($ path );
@@ -99,9 +58,5 @@ public function get($path = '')
9958 public function clean ()
10059 {
10160 $ 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- );
10661 }
10762}
0 commit comments