Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SecurityInfo.php
Go to the documentation of this file.
1 <?php
7 
8 use \Magento\Store\Model\Store;
9 use \Magento\Store\Model\ScopeInterface as StoreScopeInterface;
10 
15 {
19  protected $scopeConfig;
20 
24  public function __construct(\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig)
25  {
26  $this->scopeConfig = $scopeConfig;
27  }
28 
38  public function aroundIsSecure(\Magento\Framework\Url\SecurityInfo $subject, \Closure $proceed, $url)
39  {
40  if ($this->scopeConfig->getValue(Store::XML_PATH_SECURE_IN_FRONTEND, StoreScopeInterface::SCOPE_STORE)) {
41  return $proceed($url);
42  } else {
43  return false;
44  }
45  }
46 }
aroundIsSecure(\Magento\Framework\Url\SecurityInfo $subject, \Closure $proceed, $url)
__construct(\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig)
const XML_PATH_SECURE_IN_FRONTEND
Definition: Store.php:70