returns host, port, base dir, ssl information as assotiative array, false on error
takes this info from eShop config.inc.php (via oxConfig class)

@return array
421825
protected function _getShopSSLHostInfoFromConfig()
    {
        $sSSLShopURL = Registry::getConfig()->getConfigParam('sSSLShopURL');
        if (preg_match('#^(https?://)?([^/:]+)(:([0-9]+))?(/.*)?$#i', $sSSLShopURL, $m)) {
            $sHost = $m[2];
            $iPort = (int) $m[4];
            $blSsl = (strtolower($m[1]) == 'https://');
            if (!$iPort) {
                $iPort = $blSsl ? 443 : 80;
            }
            $sScript = rtrim($m[5], '/') . '/';

            return [
                'host' => $sHost,
                'port' => $iPort,
                'dir'  => $sScript,
                'ssl'  => $blSsl,
            ];
        }

        return false;
    }
181923
public function getConfig(): array
	{
		global $txt, $modSettings;

		$file = $this->_app->boardDir .'/_config'. $this->_app->name .'.json';

		// Already loaded or does not use config?
		if ($this->_config || !$this->_app->useConfig)
			return $this->_config;

		// Check for a $modSettings key first.
		if (!empty($modSettings['_config'. $this->_app->name]))
			return $this->_config = smf_json_decode($modSettings['_config'. $this->_app->name], true);

		// Get the json file. Must be located in $boarddir folder.
		if (!$this->_config && !file_exists($file))
		{
			loadLanguage('Errors');
			log_error(sprintf($txt['error_bad_file'], $file));
		}

		else
			$this->_config = smf_json_decode(file_get_contents($file), true);

		return $this->_config;
	}
1137131
public function getBusinessEntityExtends()
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        $aExtends = [];

        foreach ($this->_aBusinessEntityExtends as $sExtend) {
            $aExtends[$sExtend] = $myConfig->getConfigParam($sExtend);
        }

        return $aExtends;
    }
145518
private function getHostname()
    {
        $host = parse_url($this->config->get('psx_url'), PHP_URL_HOST);
        if (empty($host)) {
            $host = $_SERVER['SERVER_NAME'];
        }

        return $host;
    }
852537
public static function getServerDirectoryKeys()
    {
        return array(
            DirectoryKeys::BASE,
            DirectoryKeys::TMP,
            DirectoryKeys::DEPLOY,
            DirectoryKeys::WEBAPPS,
            DirectoryKeys::VAR_TMP,
            DirectoryKeys::VAR_LOG,
            DirectoryKeys::VAR_RUN,
            DirectoryKeys::ETC,
            DirectoryKeys::ETC_APPSERVER,
            DirectoryKeys::ETC_APPSERVER_CONFD
        );
    }
135193
public function getHeaders(): array
	{
		$headers = [];

		foreach($this->parameters as $key => $value)
		{
			if(strpos($key, 'HTTP_') === 0)
			{
				$headers[substr($key, 5)] = $value;
			}
			elseif(in_array($key, ['CONTENT_LENGTH', 'CONTENT_MD5', 'CONTENT_TYPE']))
			{
				$headers[$key] = $value;
			}
		}

		return $headers;
	}
224648
public function getPayPalSandboxHost()
    {
        $host = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sPayPalSandboxHost');
        if ($host) {
            $this->setPayPalSandboxHost($host);
        }

        return $this->payPalSandboxHost;
    }
1216798
function GetDSN()
    {
	    return array(
		    'phptype'  => $this->Type,
		    'username' => $this->Username,
		    'password' => $this->Password,
		    'hostspec' => $this->ConnectionString,
		    'database' => $this->DBName,
	    );
	}
164264
public function getServers()
    {
        $servers = [];

        if (isset($this->config['servers']) && is_array($this->config['servers'])) {
            foreach ($this->config['servers'] as $server) {
                $servers[] = $server['name'];
            }
        }

        return $servers;
    }
1164669
protected function _getShopHostInfoFromServerVars()
    {
        // got here from setup dir
        $sScript = $_SERVER['SCRIPT_NAME'];
        $iPort = (int) $_SERVER['SERVER_PORT'];
        $blSsl = (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on'));
        if (!$iPort) {
            $iPort = $blSsl ? 443 : 80;
        }
        $sScript = rtrim(dirname(dirname($sScript)), '/') . '/';

        return [
            'host' => $_SERVER['HTTP_HOST'],
            'port' => $iPort,
            'dir'  => $sScript,
            'ssl'  => $blSsl,
        ];
    }
776823
public function getHeadersAsArray()
    {
        $headers = array();
        foreach ($this->getHeaders() as $headerNode) {
            $header = array(
                'type' => $headerNode->getType(),
                'name' => $headerNode->getName(),
                'value' => $headerNode->getValue(),
                'uri' => $headerNode->getUri(),
                'override' => $headerNode->getOverride(),
                'append' => $headerNode->getAppend()
            );
            $headers[$headerNode->getType()][] = $header;
        }
        return $headers;
    }
822420
public static function getAcceptableOrigins()
    {
        $host = Url::getCurrentHost(null);
        $port = '';

        // parse host:port
        if (preg_match('/^([^:]+):([0-9]+)$/D', $host, $matches)) {
            $host = $matches[1];
            $port = $matches[2];
        }

        if (empty($host)) {
            return array();
        }

        // standard ports
        $origins = array(
            'http://' . $host,
            'https://' . $host,
        );

        // non-standard ports
        if (!empty($port) && $port != 80 && $port != 443) {
            $origins[] = 'http://' . $host . ':' . $port;
            $origins[] = 'https://' . $host . ':' . $port;
        }

        return $origins;
    }
512187
protected function getKeyInfo()
    {
        if ($this->keyInfo === null) {
            $curlVersion = curl_version();
            $environment = $this->getShopCapabilities()->getShopEnvironment();
            $hostName = $this->getHostName();
            // remove TLD.
            $pos = strrpos($hostName, '.');
            if ($pos !== false) {
                $hostName = substr($hostName, 0, $pos);
            }
            // As utf8 is now commonly accepted, it is a bit difficult to
            // express the set of characters that are allowed for email
            // addresses, so we remove characters not allowed.
            // See http://stackoverflow.com/a/2049537/1475662: @ ()[]\:;"<>,
            $hostName = str_replace(array(' ', '@', '(', ')', '[', ']', '\\', ':', ';', '"', '<', '>', ','), '', $hostName);

            $this->keyInfo = array(
                'baseUri' => array(
                    'group' => 'environment',
                    'type' => 'string',
                    'default' => Api::baseUri,
                ),
                'apiVersion' => array(
                    'group' => 'environment',
                    'type' => 'string',
                    'default' => Api::apiVersion,
                ),
                'libraryVersion' => array(
                    'group' => 'environment',
                    'type' => 'string',
                    'default' => PluginConfig::Version,
                ),
                'moduleVersion' => array(
                    'group' => 'environment',
                    'type' => 'string',
                    'default' => $environment['moduleVersion'],
                ),
                'shopName' => array(
                    'group' => 'environment',
                    'type' => 'string',
                    'default' => $environment['shopName'],
                ),
                'shopVersion' => array(
                    'group' => 'environment',
                    'type' => 'string',
                    'default' => $environment['shopVersion'],
                ),
                'hostName' => array(
                    'group' => 'environment',
                    'type' => 'string',
                    'default' => $this->getHostName(),
                ),
                'phpVersion' => array(
                    'group' => 'environment',
                    'type' => 'string',
                    'default' => phpversion(),
                ),
                'os' => array(
                    'group' => 'environment',
                    'type' => 'string',
                    'default' => php_uname(),
                ),
                'curlVersion' => array(
                    'group' => 'environment',
                    'type' => 'string',
                    'default' => "{$curlVersion['version']} (ssl: {$curlVersion['ssl_version']}; zlib: {$curlVersion['libz_version']})",
                ),
                'jsonVersion' => array(
                    'group' => 'environment',
                    'type' => 'string',
                    'default' => phpversion('json'),
                ),
                'debug' => array(
                    'group' => 'plugin',
                    'type' => 'int',
                    'default' => PluginConfig::Send_SendAndMailOnError,
                ),
                'logLevel' => array(
                    'group' => 'plugin',
                    'type' => 'int',
                    'default' => Log::Notice,
                ),
                'outputFormat' => array(
                    'group' => 'plugin',
                    'type' => 'string',
                    'default' => Api::outputFormat,
                ),
                Tag::ContractCode => array(
                    'group' => 'credentials',
                    'type' => 'string',
                    'default' => '',
                ),
                Tag::UserName => array(
                    'group' => 'credentials',
                    'type' => 'string',
                    'default' => '',
                ),
                Tag::Password => array(
                    'group' => 'credentials',
                    'type' => 'string',
                    'default' => '',
                ),
                Tag::EmailOnError => array(
                    'group' => 'credentials',
                    'type' => 'string',
                    'default' => '',
                ),
                'defaultCustomerType' => array(
                    'group' => Tag::Customer,
                    'type' => 'int',
                    'default' => 0,
                ),
                'sendCustomer' => array(
                    'group' => Tag::Customer,
                    'type' => 'bool',
                    'default' => true,
                ),
                'genericCustomerEmail' => array(
                    'group' => Tag::Customer,
                    'type' => 'string',
                    'default' => "consumer.$hostName@nul.sielsystems.nl",
                ),
                'emailIfAbsent' => array(
                    'group' => Tag::Customer,
                    'type' => 'string',
                    'default' => "$hostName@nul.sielsystems.nl",
                ),
                'contactYourId' => array(
                    'group' => Tag::Customer,
                    'type' => 'string',
                    'default' => '',
                ),
                'contactStatus' => array(
                    'group' => Tag::Customer,
                    'type' => 'int',
                    'default' => Api::ContactStatus_Active,
                ),
                'companyName1' => array(
                    'group' => Tag::Customer,
                    'type' => 'string',
                    'default' => '',
                ),
                'companyName2' => array(
                    'group' => Tag::Customer,
                    'type' => 'string',
                    'default' => '',
                ),
                'fullName' => array(
                    'group' => Tag::Customer,
                    'type' => 'string',
                    'default' => '',
                ),
                'salutation' => array(
                    'group' => Tag::Customer,
                    'type' => 'string',
                    'default' => '',
                ),
                'address1' => array(
                    'group' => Tag::Customer,
                    'type' => 'string',
                    'default' => '',
                ),
                'address2' => array(
                    'group' => Tag::Customer,
                    'type' => 'string',
                    'default' => '',
                ),
                'postalCode' => array(
                    'group' => Tag::Customer,
                    'type' => 'string',
                    'default' => '',
                ),
                'city' => array(
                    'group' => Tag::Customer,
                    'type' => 'string',
                    'default' => '',
                ),
                'vatNumber' => array(
                    'group' => Tag::Customer,
                    'type' => 'string',
                    'default' => '',
                ),
                'telephone' => array(
                    'group' => Tag::Customer,
                    'type' => 'string',
                    'default' => '',
                ),
                'fax' => array(
                    'group' => Tag::Customer,
                    'type' => 'string',
                    'default' => '',
                ),
                'email' => array(
                    'group' => Tag::Customer,
                    'type' => 'string',
                    'default' => '',
                ),
                'overwriteIfExists' => array(
                    'group' => Tag::Customer,
                    'type' => 'bool',
                    'default' => true,
                ),
                'mark' => array(
                    'group' => Tag::Customer,
                    'type' => 'string',
                    'default' => '',
                ),
                'concept' => array(
                    'group' => Tag::Invoice,
                    'type' => 'int',
                    'default' => PluginConfig::Concept_Plugin,
                ),
                'missingAmount' => array(
                    'group' => Tag::Invoice,
                    'type' => 'int',
                    'default' => PluginConfig::MissingAmount_Warn,
                ),
                'defaultAccountNumber' => array(
                    'group' => Tag::Invoice,
                    'type' => 'int',
                    'default' => 0,
                ),
                'defaultCostCenter' => array(
                    'group' => Tag::Invoice,
                    'type' => 'int',
                    'default' => 0,
                ),
                'defaultInvoiceTemplate' => array(
                    'group' => Tag::Invoice,
                    'type' => 'int',
                    'default' => 0,
                ),
                'defaultInvoicePaidTemplate' => array(
                    'group' => Tag::Invoice,
                    'type' => 'int',
                    'default' => 0,
                ),
                'paymentMethodAccountNumber' => array(
                    'group' => Tag::Invoice,
                    'type' => 'array',
                    'default' => array(),
                ),
                'paymentMethodCostCenter' => array(
                    'group' => Tag::Invoice,
                    'type' => 'array',
                    'default' => array(),
                ),
                'sendEmptyShipping' => array(
                    'group' => Tag::Invoice,
                    'type' => 'bool',
                    'default' => true,
                ),
                'optionsShow' => array(
                    'group' => Tag::Invoice,
                    'type' => 'bool',
                    'default' => true,
                ),
                'optionsAllOn1Line' => array(
                    'group' => Tag::Invoice,
                    'type' => 'int',
                    'default' => 2,
                ),
                'optionsAllOnOwnLine' => array(
                    'group' => Tag::Invoice,
                    'type' => 'int',
                    'default' => 4,
                ),
                'optionsMaxLength' => array(
                    'group' => Tag::Invoice,
                    'type' => 'int',
                    'default' => 80,
                ),
                'description' => array(
                    'group' => Tag::Invoice,
                    'type' => 'string',
                    'default' => '[invoiceSource::type+invoiceSource::reference+"-"+refundedInvoiceSource::type+refundedInvoiceSource::reference]',
                ),
                'descriptionText' => array(
                    'group' => Tag::Invoice,
                    'type' => 'string',
                    'default' => '',
                ),
                'invoiceNotes' => array(
                    'group' => Tag::Invoice,
                    'type' => 'string',
                    'default' => '',
                ),
                'itemNumber' => array(
                    'group' => Tag::Invoice,
                    'type' => 'string',
                    'default' => '',
                ),
                'productName' => array(
                    'group' => Tag::Invoice,
                    'type' => 'string',
                    'default' => '',
                ),
                'nature' => array(
                    'group' => Tag::Invoice,
                    'type' => 'string',
                    'default' => '',
                ),
                'costPrice' => array(
                    'group' => Tag::Invoice,
                    'type' => 'string',
                    'default' => '',
                ),
                'nature_shop' => array(
                    'group' => 'shop',
                    'type' => 'int',
                    'default' => PluginConfig::Nature_Unknown,
                ),
                'foreignVat' => array(
                    'group' => 'shop',
                    'type' => 'int',
                    'default' => PluginConfig::ForeignVat_Unknown,
                ),
                'vatFreeProducts' => array(
                    'group' => 'shop',
                    'type' => 'int',
                    'default' => PluginConfig::VatFreeProducts_Unknown,
                ),
                'marginProducts' => array(
                    'group' => 'shop',
                    'type' => 'int',
                    'default' => PluginConfig::MarginProducts_Unknown,
                ),
                // @todo: should we also create a 0 rate vat classes?
                'foreignVatClasses' => array(
                    'group' => 'shop',
                    'type' => 'array',
                    'default' => array(),
                ),
                'invoiceNrSource' => array(
                    'group' => 'shop',
                    'type' => 'int',
                    'default' => PluginConfig::InvoiceNrSource_ShopInvoice,
                ),
                'dateToUse' => array(
                    'group' => 'shop',
                    'type' => 'int',
                    'default' => PluginConfig::InvoiceDate_InvoiceCreate,
                ),
                'triggerOrderStatus' => array(
                    'group' => 'event',
                    'type' => 'array',
                    'default' => array(),
                ),
                'triggerInvoiceEvent' => array(
                    'group' => 'event',
                    'type' => 'int',
                    'default' => PluginConfig::TriggerInvoiceEvent_None,
                ),
                'triggerCreditNoteEvent' => array(
                    'group' => 'event',
                    'type' => 'int',
                    'default' => PluginConfig::TriggerCreditNoteEvent_Create,
                ),
                'sendEmptyInvoice' => array(
                    'group' => 'event',
                    'type' => 'bool',
                    'default' => true,
                ),
                'emailAsPdf' => array(
                    'group' => Tag::EmailAsPdf,
                    'type' => 'bool',
                    'default' => false,
                ),
                'emailFrom' => array(
                  'group' => Tag::EmailAsPdf,
                  'type' => 'string',
                  'default' => '',
                ),
                'emailTo' => array(
                    'group' => Tag::EmailAsPdf,
                    'type' => 'string',
                    'default' => '',
                ),
                'emailBcc' => array(
                    'group' => Tag::EmailAsPdf,
                    'type' => 'string',
                    'default' => '',
                ),
                'subject' => array(
                    'group' => Tag::EmailAsPdf,
                    'type' => 'string',
                    'default' => '',
                ),
                // For now, we do not make message configurable...
                // For now we don't present the confirmReading option in the UI.
                'confirmReading' => array(
                    'group' => Tag::EmailAsPdf,
                    'type' => 'bool',
                    'default' => false,
                ),
            );
        }
        return $this->keyInfo;
    }
597431
private function getHosts($options)
    {
        $hosts = [];

        if (is_string($options['servers'])) {
            $options['servers'] = explode(',', $options['servers']);
        }

        foreach ($options['servers'] as $host) {
            if (!empty($host)) {
                list($hostname, $port) = array_pad(explode(':', trim($host), 2), 2, 9200);
                $currentHostConfig = [
                    'host'   => $hostname,
                    'port'   => $port,
                    'scheme' => isset($options['enable_https_mode']) ? 'https' : $options['scheme'] ?? 'http',
                ];

                if ($options['enable_http_auth']) {
                    $currentHostConfig['user'] = $options['http_auth_user'];
                    $currentHostConfig['pass'] = $options['http_auth_pwd'];
                }

                $hosts[] = $currentHostConfig;
            }
        }

        return $hosts;
    }
1282673
public function getDefaultPathParams()
    {
        // default values
        $aParams['sShopDir'] = "";
        $aParams['sShopURL'] = "";

        // try path translated
        if (isset($_SERVER['PATH_TRANSLATED']) && ($_SERVER['PATH_TRANSLATED'] != '')) {
            $sFilepath = $_SERVER['PATH_TRANSLATED'];
        } else {
            $sFilepath = $_SERVER['SCRIPT_FILENAME'];
        }

        $aParams['sShopDir'] = str_replace("\\", "/", $this->_extractPath(preg_split("/\\\|\//", $sFilepath)));
        $aParams['sCompileDir'] = $aParams['sShopDir'] . "tmp/";

        // try referer
        $sFilepath = @$_SERVER['HTTP_REFERER'];
        if (!isset($sFilepath) || !$sFilepath) {
            $sFilepath = "http://" . @$_SERVER['HTTP_HOST'] . @$_SERVER['SCRIPT_NAME'];
        }
        $aParams['sShopURL'] = ltrim($this->_extractPath(explode("/", $sFilepath)), "/");

        return $aParams;
    }
968799
public function getUthandoConfig(): array
    {
        $config             = [];
        $configFilePattern  = join('/', [
            $this->getModulePath(),
            $this->configDirectory,
            $this->filePattern,
        ]);

        foreach (glob($configFilePattern) as $filename) {
            /** @noinspection PhpIncludeInspection */
            $configFile = include $filename;
            $config     = array_merge($config, $configFile);
        }

        return $config;
    }
39460
public function getHttpHeadersArray():array {
		$headers = [];

		foreach($this->server as $key => $value) {
			if(strpos($key, "HTTP_") !== 0) {
				continue;
			}

			$headerName = substr($key, strlen("HTTP_"));
			$headerName = strtoupper($headerName);
			$headers[$headerName] = $value;
		}

		return $headers;
	}