You are here

protected function AbstractCallback::_getHeader in Zircon Profile 8.0

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

Retrieve a Header value from either $_SERVER or Apache

Parameters

string $header:

Return value

bool|string

File

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

Class

AbstractCallback

Namespace

Zend\Feed\PubSubHubbub

Code

protected function _getHeader($header) {
  $temp = strtoupper(str_replace('-', '_', $header));
  if (!empty($_SERVER[$temp])) {
    return $_SERVER[$temp];
  }
  $temp = 'HTTP_' . strtoupper(str_replace('-', '_', $header));
  if (!empty($_SERVER[$temp])) {
    return $_SERVER[$temp];
  }
  if (function_exists('apache_request_headers')) {
    $headers = apache_request_headers();
    if (!empty($headers[$header])) {
      return $headers[$header];
    }
  }
  return false;
}