Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
StoreConfigurationDataMapper.php
Go to the documentation of this file.
1 <?php
7 namespace Magento\Setup\Model;
8 
14 use Magento\Ui\Model\Config as UiConfig;
15 
22 {
26  const KEY_USE_SEF_URL = 'use-rewrites';
27  const KEY_BASE_URL = 'base-url';
28  const KEY_BASE_URL_SECURE = 'base-url-secure';
29  const KEY_IS_SECURE = 'use-secure';
30  const KEY_IS_SECURE_ADMIN = 'use-secure-admin';
31  const KEY_LANGUAGE = 'language';
32  const KEY_TIMEZONE = 'timezone';
33  const KEY_CURRENCY = 'currency';
34  const KEY_ADMIN_USE_SECURITY_KEY = 'admin-use-security-key';
35  const KEY_JS_LOGGING = 'js-logging';
39  private $pathDataMap = [
51  UiConfig::XML_PATH_LOGGING => self::KEY_JS_LOGGING
52  ];
53 
60  public function getConfigData($installParamData)
61  {
62  $configData = [];
63 
64  foreach ($this->pathDataMap as $path => $key) {
65  $configData = $this->addParamToConfigData($configData, $installParamData, $key, $path);
66  }
67  return $configData;
68  }
69 
79  private function addParamToConfigData($configData, $installParamData, $key, $path)
80  {
81  if (isset($installParamData[$key])) {
82  if (($key === self::KEY_BASE_URL) || ($key === self::KEY_BASE_URL_SECURE)) {
83  $installParamData[$key] = rtrim($installParamData[$key], '/') . '/';
84  }
85  $configData[$path] = $installParamData[$key];
86  }
87  return $configData;
88  }
89 }
const XML_PATH_UNSECURE_BASE_URL
Definition: Store.php:66
const XML_PATH_SECURE_IN_FRONTEND
Definition: Store.php:70
const XML_PATH_USE_SECURE_KEY
Definition: Url.php:26
const XML_PATH_SECURE_BASE_URL
Definition: Store.php:68
const XML_PATH_SECURE_IN_ADMINHTML
Definition: Store.php:72