Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
UrlBuilder.php
Go to the documentation of this file.
1 <?php
7 
9 
14 {
20  private static $notificationContentUrlConfigPath = 'system/release_notification/content_url';
21 
27  private static $useHttpsFlagConfigPath = 'system/release_notification/use_https';
28 
32  private $config;
33 
37  public function __construct(ScopeConfigInterface $config)
38  {
39  $this->config = $config;
40  }
41 
50  public function getUrl($version, $edition, $locale)
51  {
52  $scheme = $this->config->isSetFlag(self::$useHttpsFlagConfigPath) ? 'https://' : 'http://';
53  $baseUrl = $this->config->getValue(self::$notificationContentUrlConfigPath);
54  if (empty($baseUrl)) {
55  return '';
56  } else {
57  $url = $scheme . $baseUrl;
58  $url .= empty($version) ? '' : '/' . $version;
59  $url .= empty($edition) ? '' : '/' . $edition;
60  $url .= empty($locale) ? '' : '/' . $locale;
61  return $url . '.json';
62  }
63  }
64 }
$config
Definition: fraud_order.php:17
foreach(array_keys($composerData['require']) as $requiredPackage) if(empty($edition)) if(!empty($opts['edition'])) $edition