![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/framework/App/ObjectManager/ |
<?php /** * Object manager configuration cache * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Framework\App\ObjectManager; use Magento\Framework\Serialize\SerializerInterface; use Magento\Framework\Serialize\Serializer\Serialize; class ConfigCache implements \Magento\Framework\ObjectManager\ConfigCacheInterface { /** * @var \Magento\Framework\Cache\FrontendInterface */ protected $_cacheFrontend; /** * Cache prefix * * @var string */ protected $_prefix = 'diConfig'; /** * @var SerializerInterface */ private $serializer; /** * @param \Magento\Framework\Cache\FrontendInterface $cacheFrontend */ public function __construct(\Magento\Framework\Cache\FrontendInterface $cacheFrontend) { $this->_cacheFrontend = $cacheFrontend; } /** * Retrieve configuration from cache * * @param string $key * @return array|false */ public function get($key) { $data = $this->_cacheFrontend->load($this->_prefix . $key); if (!$data) { return false; } return $this->getSerializer()->unserialize($data); } /** * Save config to cache * * @param array $config * @param string $key * @return void */ public function save(array $config, $key) { $this->_cacheFrontend->save($this->getSerializer()->serialize($config), $this->_prefix . $key); } /** * Get serializer * * @return SerializerInterface * @deprecated 101.0.0 */ private function getSerializer() { if (null === $this->serializer) { $this->serializer = \Magento\Framework\App\ObjectManager::getInstance()->get(Serialize::class); } return $this->serializer; } }