74 $this->scopeConfig = $scopeConfig;
88 $isCustomPathUsed = (bool)(
string)$this->config->getValue(self::XML_PATH_USE_CUSTOM_ADMIN_PATH);
89 if ($isCustomPathUsed) {
90 return (
string)$this->config->getValue(self::XML_PATH_CUSTOM_ADMIN_PATH);
107 $host = isset($_SERVER[
'HTTP_HOST']) ? $_SERVER[
'HTTP_HOST'] :
'';
108 return stripos($this->getHostWithPort($backendUrl), $host) !==
false;
117 private function getHostWithPort(
$url)
119 $scheme = parse_url(trim(
$url), PHP_URL_SCHEME);
120 $host = parse_url(trim(
$url), PHP_URL_HOST);
121 $port = parse_url(trim(
$url), PHP_URL_PORT);
123 $port = isset($this->standardPorts[$scheme]) ? $this->standardPorts[$scheme] :
null;
125 return isset($port) ? $host .
':' . $port : $host;
const XML_PATH_USE_CUSTOM_ADMIN_URL
const XML_PATH_UNSECURE_BASE_URL
__construct(\Magento\Backend\App\Config $config, DeploymentConfig $deploymentConfig, ScopeConfigInterface $scopeConfig)
const XML_PATH_CUSTOM_ADMIN_PATH
const XML_PATH_USE_CUSTOM_ADMIN_PATH
getFrontName($checkHost=false)
const XML_PATH_CUSTOM_ADMIN_URL
const CONFIG_PATH_BACKEND_FRONTNAME