b374k
m1n1 1.01
Apache/2.4.41 (Ubuntu)
Linux vmi616275.contaboserver.net 5.4.0-84-generic #94-Ubuntu SMP Thu Aug 26 20:27:37 UTC 2021 x86_64
uid=33(www-data) gid=33(www-data) groups=33(www-data)
server ip : 62.171.164.128 | your ip : 127.0.0.1
safemode OFF
 >  / home / dev2.destoffenstraat.com / vendor / magento / framework / App / Config /
Filename/home/dev2.destoffenstraat.com/vendor/magento/framework/App/Config/Initial.php
Size2.31 kb
Permissionrw-r--r--
Ownerroot : root
Create time17-Aug-2025 10:26
Last modified07-Jan-2021 21:08
Last accessed23-Aug-2025 03:56
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
<?php
/**
* Initial configuration data container. Provides interface for reading initial config values
*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Framework\App\Config;

use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Framework\Serialize\SerializerInterface;

class Initial
{
/**
* Cache identifier used to store initial config
*/
const CACHE_ID = 'initial_config';

/**
* Config data
*
* @var array
*/
protected $_data = [];

/**
* Config metadata
*
* @var array
*/
protected $_metadata = [];

/**
* @var SerializerInterface
*/
private $serializer;

/**
* Initial constructor
*
* @param Initial\Reader $reader
* @param \Magento\Framework\App\Cache\Type\Config $cache
* @param SerializerInterface|null $serializer
*/
public function __construct(
\Magento\Framework\App\Config\Initial\Reader $reader,
\Magento\Framework\App\Cache\Type\Config $cache,
SerializerInterface $serializer = null
) {
$this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance()
->get(SerializerInterface::class);
$data = $cache->load(self::CACHE_ID);
if (!$data) {
$data = $reader->read();
$cache->save($this->serializer->serialize($data), self::CACHE_ID);
} else {
$data = $this->serializer->unserialize($data);
}
$this->_data = $data['data'];
$this->_metadata = $data['metadata'];
}

/**
* Get initial data by given scope
*
* @param string $scope Format is scope type and scope code separated by pipe: e.g. "type|code"
* @return array
*/
public function getData($scope)
{
list($scopeType, $scopeCode) = array_pad(explode('|', $scope), 2, null);

if (ScopeConfigInterface::SCOPE_TYPE_DEFAULT == $scopeType) {
return $this->_data[$scopeType] ?? [];
} elseif ($scopeCode) {
return $this->_data[$scopeType][$scopeCode] ?? [];
}
return [];
}

/**
* Get configuration metadata
*
* @return array
*/
public function getMetadata()
{
return $this->_metadata;
}
}