当前位置: 首页>>代码示例>>PHP>>正文


PHP Http::getScheme方法代码示例

本文整理汇总了PHP中Magento\Framework\App\Request\Http::getScheme方法的典型用法代码示例。如果您正苦于以下问题:PHP Http::getScheme方法的具体用法?PHP Http::getScheme怎么用?PHP Http::getScheme使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Magento\Framework\App\Request\Http的用法示例。


在下文中一共展示了Http::getScheme方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: redirectToSetup

 /**
  * If not installed, try to redirect to installation wizard
  *
  * @param Bootstrap $bootstrap
  * @param \Exception $exception
  * @return void
  * @throws \Exception
  */
 private function redirectToSetup(Bootstrap $bootstrap, \Exception $exception)
 {
     $setupInfo = new SetupInfo($bootstrap->getParams());
     $projectRoot = $this->_filesystem->getDirectoryRead(DirectoryList::ROOT)->getAbsolutePath();
     if ($setupInfo->isAvailable()) {
         $this->_response->setRedirect($setupInfo->getUrl());
         $this->_response->sendHeaders();
     } else {
         $newMessage = $exception->getMessage() . "\nNOTE: You cannot install Magento using the Setup Wizard " . "because the Magento setup directory cannot be accessed. \n" . 'You can install Magento using either the command line or you must restore access ' . 'to the following directory: ' . $setupInfo->getDir($projectRoot) . "\n";
         $newMessage .= 'If you are using the sample nginx configuration, please go to ' . $this->_request->getScheme() . '://' . $this->_request->getHttpHost() . $setupInfo->getUrl();
         throw new \Exception($newMessage, 0, $exception);
     }
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:21,代码来源:Http.php

示例2: _isBaseUrlCorrect

 /**
  * Check if base url enabled
  *
  * @param array $uri
  * @param \Magento\Framework\App\Request\Http $request
  * @return bool
  */
 protected function _isBaseUrlCorrect($uri, $request)
 {
     $requestUri = $request->getRequestUri() ? $request->getRequestUri() : '/';
     return (!isset($uri['scheme']) || $uri['scheme'] === $request->getScheme()) && (!isset($uri['host']) || $uri['host'] === $request->getHttpHost()) && (!isset($uri['path']) || strpos($requestUri, $uri['path']) !== false);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:12,代码来源:RequestPreprocessor.php

示例3: execute

 /**
  * Performs verification.
  *
  * @param array $uri
  * @param \Magento\Framework\App\Request\Http $request
  * @return bool
  */
 public function execute($uri, $request)
 {
     $requestUri = $request->getRequestUri() ? $request->getRequestUri() : '/';
     return (!isset($uri['scheme']) || $uri['scheme'] === $request->getScheme()) && (!isset($uri['host']) || $uri['host'] === $request->getHttpHost()) && (!isset($uri['path']) || strpos($requestUri, $uri['path']) !== false);
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:12,代码来源:BaseUrlChecker.php


注:本文中的Magento\Framework\App\Request\Http::getScheme方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。