Пример #1
0
 /**
  * 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;
 }
Пример #2
0
 /**
  * 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;
 }
Пример #3
0
 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());
 }
Пример #4
0
 /**
  * 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;
 }
Пример #5
0
 /**
  * Return Backend area front name
  *
  * @return string
  */
 public function getAreaFrontName()
 {
     return $this->_frontNameResolver->getFrontName();
 }
Пример #6
0
 /**
  * Return Backend area front name
  *
  * @param bool $checkHost
  * @return bool|string
  */
 public function getAreaFrontName($checkHost = false)
 {
     return $this->_frontNameResolver->getFrontName($checkHost);
 }