/** * Determine the admin path * * @return string */ private function extractAdminPath() { $parsedUrl = parse_url($this->_storeManager->getStore()->getBaseUrl()); $baseUrl = $parsedUrl['path']; $adminPath = $this->_frontNameResolver->getFrontName(); return $baseUrl . $adminPath; }
/** * Determine the admin path * * @param string $baseUrl * @return string * @throws \InvalidArgumentException */ private function extractAdminPath($baseUrl) { if (!is_string($baseUrl)) { throw new \InvalidArgumentException('Cookie path is not a string.'); } $adminPath = $this->frontNameResolver->getFrontName(); if (!substr($baseUrl, -1) || '/' != substr($baseUrl, -1)) { $baseUrl = $baseUrl . '/'; } return $baseUrl . $adminPath; }
public function testIfCustomPathNotUsed() { $this->_configMock->expects( $this->once() )->method( 'getValue' )->with( 'admin/url/use_custom_path' )->will( $this->returnValue(false) ); $this->assertEquals($this->_defaultFrontName, $this->_model->getFrontName()); }
/** * Determine the admin path * * @return string */ private function extractAdminPath() { $backendApp = $this->backendAppList->getCurrentApp(); $cookiePath = null; $baseUrl = parse_url($this->backendUrlFactory->create()->getBaseUrl(), PHP_URL_PATH); if (!$backendApp) { $cookiePath = $baseUrl . $this->_frontNameResolver->getFrontName(); return $cookiePath; } //In case of application authenticating through the admin login, the script name should be removed //from the path, because application has own script. $baseUrl = \Magento\Framework\App\Request\Http::getUrlNoScript($baseUrl); $cookiePath = $baseUrl . $backendApp->getCookiePath(); return $cookiePath; }
/** * Return Backend area front name * * @return string */ public function getAreaFrontName() { return $this->_frontNameResolver->getFrontName(); }
/** * Return Backend area front name * * @param bool $checkHost * @return bool|string */ public function getAreaFrontName($checkHost = false) { return $this->_frontNameResolver->getFrontName($checkHost); }