You are here

protected function AbstractCallback::_getHttpHost in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-feed/src/PubSubHubbub/AbstractCallback.php \Zend\Feed\PubSubHubbub\AbstractCallback::_getHttpHost()

Get the HTTP host

Return value

string

1 call to AbstractCallback::_getHttpHost()
AbstractCallback::_detectCallbackUrl in vendor/zendframework/zend-feed/src/PubSubHubbub/AbstractCallback.php
Attempt to detect the callback URL (specifically the path forward)

File

vendor/zendframework/zend-feed/src/PubSubHubbub/AbstractCallback.php, line 230

Class

AbstractCallback

Namespace

Zend\Feed\PubSubHubbub

Code

protected function _getHttpHost() {
  if (!empty($_SERVER['HTTP_HOST'])) {
    return $_SERVER['HTTP_HOST'];
  }
  $scheme = 'http';
  if ($_SERVER['HTTPS'] == 'on') {
    $scheme = 'https';
  }
  $name = $_SERVER['SERVER_NAME'];
  $port = $_SERVER['SERVER_PORT'];
  if ($scheme == 'http' && $port == 80 || $scheme == 'https' && $port == 443) {
    return $name;
  }
  return $name . ':' . $port;
}