Read a header value by name from the remote content.

@param  mixed $key Header name
@return mixed
974194
private function getHeader($key)
    {
        if (! $this->headers) {
            $this->headers = $this->getHeaders();
        }
        if (array_key_exists($key, $this->headers)) {
            //if redirects encountered, return the final values
            if (is_array($this->headers[$key])) {
                return end($this->headers[$key]);
            } else {
                return $this->headers[$key];
            }
        }
    }
737554
public function read($key)
    {
        $this->_cachedData or $this->_cachedData = Cache::get('model-metadata');
        return isset($this->_cachedData[$key]) ? $this->_cachedData[$key] : null;
    }
485608
public function hasHeader($key)
    {
        foreach ($this->responseHeaders as $k => $v) {
            if (\strtoupper($key) === \strtoupper($k)) {
                return true;
            }
        }

        return false;
    }
28435
protected function setHeaderName(string $key)
        {
            $key = strtr(strtolower($key), '_', '-');
            if (strpos($key, 'http-') === 0) {
                $key = substr($key, 5);
            }
            return $key;
        }
348358
public function getHeader( $key = NULL )
	{
		if( empty( $key ) )
			return $this->header;
		else
		{
			$key = strtoupper( $key );
			if( isset( $this->caseless[$key] ) )
				return $this->header[$this->caseless[$key]];
			else
				return NULL;
		}
	}
1092265
public static function read($key = false)
    {
        if(is_array($key) && !empty($key)) {
            $_value_to_be_returned = self::$_config;
            foreach(array_values($key) as $key => $_val) {
                $_value_to_be_returned = $_value_to_be_returned[$_val];
            }

            return $_value_to_be_returned;
        }

        return isset(self::$_config[$key]) ? self::$_config[$key] : false;
    }
1079459
public function hasHeader($name)
        {
            $name = $this->setHeaderName($name);
            return array_key_exists($name, $this->headers);
        }
1044959
public function get($key)
    {
        $connection = $this->getConnection($key);
        $this->writeToRemote(array(
            'cmd' => 'get',
            'key' => $key,
        ), $connection);
        return $this->readFromRemote($connection);
    }
626895
public function read($key)
    {
        $data = $this->redis->get($this->prefix . $key);
        return $data === null ? false : (is_numeric($data) ? $data : unserialize($data));
    }
748377
public function getHeader($key)
    {
        foreach ($this->responseHeaders as $k => $v) {
            if (\strtoupper($key) === \strtoupper($k)) {
                return $v;
            }
        }

        throw new ResponseException(\sprintf('header "%s" not set', $key));
    }
888337
public function read($key)
    {
        if ($value = $this->redis->get($key)) {
            $arr = unserialize($value);
            $this->changed = $arr['changed'];
            $this->ip      = $arr['ip'];
            $this->vars    = $arr['vars'];
            $this->key     = $key;

            return !empty($this->vars) ? (string) $this->vars : '';
        }

        return '';
    }
182580
public function get(string $key) {
		return ($content = $this->driver->get($key)) ? static::unserialize($content) : null;
	}
1021583
public static function getHeaderValue($key = 'Content-Type', $headers = array())
	{
		$value = null;
		if (empty($headers)) {
			// no headers passed... determine from sent
			if (function_exists('headers_list')) {
				$headers = headers_list();
			} elseif (function_exists('apache_response_headers')) {
				// apache_response_headers is somewhat worthless.... must flush the output first via ob_end_flush
				$headers = apache_response_headers();
				if (!headers_sent()) {
					// $this->debug->warn('headers not yet sent.. unable to determine complete list');
					// $this->debug->log('headers', $headers);
				}
			} else {
				// $this->debug->warn('unable to determine sent headers');
			}
		}
		if ($headers) {
			if (is_string($headers)) {
				$headers = explode("\n", $headers);
			}
			$arrayUtil = new ArrayUtil();
			if ($arrayUtil->isHash($headers)) {
				if (isset($headers[$key])) {
					$value = $headers[$key];
				}
			} else {
				foreach ($headers as $header) {
					if (preg_match('/^'.$key.':\s*([^;]*)/i', $header, $matches)) {
						$value = $matches[1];
						break;
					}
				}
			}
		}
		if (is_null($value) && $key == 'Content-Type') {
			$value = ini_get('default_mimetype');
		}
		// $this->debug->log('value', $value);
		// $this->debug->groupEnd();
		return $value;
	}
1236260
public function get(string $key): string
    {
        $key = $this->getKey($key);
        $value = $this->headers[$key] ?? "";
        return is_array($value) ? implode(", ", $value) : $value;
    }
988015
public static function read($key)
    {
        // Check key existence
        if (!self::check($key)) {
            throw new \Exception('Configuration key "' . $key . '" doesn\'t exists');
            return false;
        }
        // Get value of key
        return self::$configList[$key];
    }
1112584
public function getHeader( $key, $first = NULL )
	{
		$fields	= $this->headers->getFieldsByName( $key );											//  get all header fields with this header name
		if( !$first )																				//  all header fields shall be returned
			return $fields;																			//  return all header fields
		if( $fields )																				//  otherwise: header fields (atleat one) are set
			return $fields[0];																		//  return first header field
		return new Net_HTTP_Header_Field( $key, NULL );												//  otherwise: return empty fake header field
	}
113391
private function getHeader($key)
    {
        if (isset($this->requestHeader[$key])) {
            $header = $this->requestHeader[$key]['value'];

            unset($this->requestHeader[$key]);
        } else {
            if ($key === 'host') {
                $header = $this->getHost();
            } elseif ($key === 'accept') {
                $header = '*/*';
            } elseif ($key === 'user-agent') {
                $header = self::$userAgent;
            }
        }

        return $header;
    }