Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AbstractExecutor.php
Go to the documentation of this file.
1 <?php
8 
10 
14 abstract class AbstractExecutor implements CurlInterface
15 {
21  protected static $baseUrl = null;
22 
28  protected static function resolveBaseUrl()
29  {
30 
31  if ((getenv('MAGENTO_RESTAPI_SERVER_HOST') !== false)
32  && (getenv('MAGENTO_RESTAPI_SERVER_HOST') !== '') ) {
33  self::$baseUrl = getenv('MAGENTO_RESTAPI_SERVER_HOST');
34  } else {
35  self::$baseUrl = getenv('MAGENTO_BASE_URL');
36  }
37 
38  if ((getenv('MAGENTO_RESTAPI_SERVER_PORT') !== false)
39  && (getenv('MAGENTO_RESTAPI_SERVER_PORT') !== '')) {
40  self::$baseUrl .= ':' . getenv('MAGENTO_RESTAPI_SERVER_PORT');
41  }
42 
43  self::$baseUrl = rtrim(self::$baseUrl, '/') . '/';
44  }
45 }