Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
framework
App
ObjectManager
ConfigCache.php
Go to the documentation of this file.
1
<?php
8
namespace
Magento\Framework\App\ObjectManager
;
9
10
use
Magento\Framework\Serialize\SerializerInterface
;
11
use
Magento\Framework\Serialize\Serializer\Serialize
;
12
13
class
ConfigCache
implements
\Magento\Framework\ObjectManager\ConfigCacheInterface
14
{
18
protected
$_cacheFrontend
;
19
25
protected
$_prefix
=
'diConfig'
;
26
30
private
$serializer;
31
35
public
function
__construct
(\
Magento
\Framework\
Cache
\FrontendInterface $cacheFrontend)
36
{
37
$this->_cacheFrontend = $cacheFrontend;
38
}
39
46
public
function
get
($key)
47
{
48
$data
= $this->_cacheFrontend->load($this->_prefix . $key);
49
if
(!
$data
) {
50
return
false
;
51
}
52
return
$this->getSerializer()->unserialize(
$data
);
53
}
54
62
public
function
save
(array
$config
, $key)
63
{
64
$this->_cacheFrontend->save($this->getSerializer()->serialize(
$config
), $this->_prefix . $key);
65
}
66
73
private
function
getSerializer()
74
{
75
if
(
null
=== $this->serializer) {
76
$this->serializer =
\Magento\Framework\App\ObjectManager::getInstance
()->get(Serialize::class);
77
}
78
return
$this->serializer;
79
}
80
}
Magento\Framework\App\ObjectManager\getInstance
static getInstance()
Definition:
ObjectManager.php:33
$config
$config
Definition:
fraud_order.php:17
Magento\Framework\App\ObjectManager\ConfigCache
Definition:
ConfigCache.php:13
Magento\Framework\App\ObjectManager\ConfigCache\__construct
__construct(\Magento\Framework\Cache\FrontendInterface $cacheFrontend)
Definition:
ConfigCache.php:35
Magento\Framework\App\Cache
Definition:
Cache.php:13
Magento\Framework\App\ObjectManager\ConfigCache\$_prefix
$_prefix
Definition:
ConfigCache.php:25
Magento\Framework\Serialize\SerializerInterface
Definition:
SerializerInterface.php:14
Magento\Framework\App\ObjectManager
Definition:
ConfigCache.php:8
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Framework\App\ObjectManager\ConfigCache\save
save(array $config, $key)
Definition:
ConfigCache.php:62
Magento\Framework\Serialize\Serializer\Serialize
Definition:
Serialize.php:14
Magento
Magento\Framework\App\ObjectManager\ConfigCache\$_cacheFrontend
$_cacheFrontend
Definition:
ConfigCache.php:18
Magento\Framework\ObjectManager\ConfigCacheInterface
Definition:
ConfigCacheInterface.php:12