/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
lib/internal/Magento/Framework/App/Config/Scope/Converter.php
47 строк
1 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 17:47
22 окт 2025, 17:47
1b769b7
Код
Авторство
О чём код?
<?php /** * Configuration data converter. Converts associative array to tree array * * Copyright 2014 Adobe * All Rights Reserved. */ namespace Magento\Framework\App\Config\Scope; class Converter implements \Magento\Framework\Config\ConverterInterface { /** * Convert config data * * @param array $source * @return array */ public function convert($source) { $output = []; foreach ($source as $key => $value) { $this->_setArrayValue($output, $key, $value); } return $output; } /** * Set array value by path * * @param array &$container * @param string $path * @param string $value * @return void */ protected function _setArrayValue(array &$container, $path, $value) { $segments = explode('/', $path); $currentPointer = & $container; foreach ($segments as $segment) { if (!isset($currentPointer[$segment])) { $currentPointer[$segment] = []; } $currentPointer = & $currentPointer[$segment]; } $currentPointer = $value; } }