getEndpointUrl() public méthode

Gets endpoint url.
public getEndpointUrl ( ) : string
Résultat string Returns Endpoint url without trailing slash
 /**
  * Parses href
  *
  * @param   string    $href  A
  * @return  object    Returns object
  */
 private function _parseHref($href)
 {
     $endpoint = rtrim($this->service->getEndpointUrl(), '/');
     //some providers gets whrong url schema in href
     $e = parse_url($endpoint);
     $a = parse_url($href);
     $ret = new \stdClass();
     $ret->base = $e['scheme'] . '://' . (isset($e['user']) ? $e['user'] . (isset($e['pass']) ? ':' . urlencode($e['pass']) : '') . '@' : '') . $e['host'] . (isset($e['port']) ? ':' . $e['port'] : '');
     $ret->path = $a['path'] . (isset($a['query']) ? '?' . $a['query'] : '') . (isset($a['fragment']) ? '#' . $a['fragment'] : '');
     $ret->components = $a;
     return $ret;
 }
Exemple #2
0
 /**
  * {@inheritdoc}
  * @see Scalr\Service\OpenStack\Services.AbstractService::getEndpointUrl()
  */
 public function getEndpointUrl()
 {
     //Endpoint url in the service catalog does not include version
     $version = '/' . lcfirst($this->getVersion()) . '.0';
     $cfg = $this->getOpenStack()->getConfig();
     return $cfg->getAuthToken() === null ? $cfg->getIdentityEndpoint() : rtrim(parent::getEndpointUrl(), $version) . $version;
 }
Exemple #3
0
 /**
  * {@inheritdoc}
  * @see Scalr\Service\OpenStack\Services.AbstractService::getEndpointUrl()
  */
 public function getEndpointUrl()
 {
     //Endpoint url in the service catalog does not include version
     $cfg = $this->getOpenStack()->getConfig();
     return $cfg->getAuthToken() === null ? $cfg->getIdentityEndpoint() : rtrim(parent::getEndpointUrl(), '/') . '/v2.0';
 }