本文整理汇总了PHP中Magento\Framework\App\Request\Http::getRequestUri方法的典型用法代码示例。如果您正苦于以下问题:PHP Http::getRequestUri方法的具体用法?PHP Http::getRequestUri怎么用?PHP Http::getRequestUri使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\App\Request\Http
的用法示例。
在下文中一共展示了Http::getRequestUri方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: log
/**
* {@inheritdoc}
*/
public function log($message, $level)
{
$message .= ' ' . $this->request->getRequestUri();
if ($this->logLevel >= $level) {
switch ($level) {
case self::EMERGENCY:
$this->logger->emergency($message);
break;
case self::ALERT:
$this->logger->alert($message);
break;
case self::CRITICAL:
$this->logger->critical($message);
break;
case self::ERROR:
$this->logger->error($message);
break;
case self::WARNING:
$this->logger->warning($message);
break;
case self::NOTICE:
$this->logger->notice($message);
break;
case self::INFO:
$this->logger->info($message);
break;
default:
$this->logger->debug($message);
}
}
}
示例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);
}
示例3: __construct
/**
* @param \Magento\Framework\App\Request\Http $request
*/
public function __construct(\Magento\Framework\App\Request\Http $request)
{
$data = [$request->isSecure(), $request->getRequestUri(), $request->get(\Magento\Framework\App\Response\Http::COOKIE_VARY_STRING)];
$this->value = md5(serialize($data));
}
示例4: 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);
}