获取请求错误信息
@param  string $header 请求返回头信息
975448
private function error($header) {
        list($status, $stash) = explode("\r\n", $header, 2);
        list($v, $code, $message) = explode(" ", $status, 3);
        $message = is_null($message) ? 'File Not Found' : "[{$status}]:{$message}";
        $this->error = $message;
    }
1335232
function fetch_header( $header = '' )
	{
		$array_headers = preg_split("/\r\n/",$this->result_header);

		$array_return = array( 0 => $array_headers[0] );
		unset($array_headers[0]);

		foreach ( $array_headers as $pair )
		{
			if ($pair == '' || $pair == "\r\n") continue;
			list($key,$value) = preg_split("/: /",$pair,2);
			$array_return[strtolower($key)] = $value;
		}

		if ( $header != '' )
		{
			return $array_return[strtolower($header)];
		}

		return $array_return;
	}
288211
private function parseHeader($header)
    {
        $res = preg_match_all('/(?:[^,"]*+(?:"[^"]*+")?)+[^,"]*+/', $header, $matches);

        if (!$res) {
            throw new InvalidHeader(sprintf('Failed to parse accept header: "%s"', $header));
        }

        return array_values(array_filter(array_map('trim', $matches[0])));
    }
29662
private function parseHeader(string $header)
    {
        if (strpos($header, 'Basic') !== 0) {
            return false;
        }

        $header = base64_decode(substr($header, 6));

        if ($header === false) {
            return false;
        }

        $header = explode(':', $header, 2);

        return [
            'username' => $header[0],
            'password' => isset($header[1]) ? $header[1] : null,
        ];
    }
728636
protected function dispatchHttpStatus($header)
    {
         $statuses = array();
         $result = preg_match('/^http\/[1|2]\.\d (\d{3}) (.*)$/i', $header, $statuses);

         if ($result < 1) {
             $this->throwException();
         }

         // Code, status text
         return array((int)$statuses[1], $statuses[2]);
    }
478498
public function header($header) {
        foreach($this->_headers as $k => $v) {
            if (!strcasecmp($k, $header)) {
                return $v;
            }
        }
        
        return null;
    }
736854
protected function header2fileinfo($header)
    {
        $fileinfo = new FileInfo();
        $fileinfo->setSize($header['size']);
        $fileinfo->setCompressedSize($header['compressed_size']);
        $fileinfo->setMtime($header['mtime']);
        $fileinfo->setComment($header['comment']);
        $fileinfo->setIsdir($header['external'] == 0x41FF0010 || $header['external'] == 16);

        if(isset($header['extradata']['utf8path'])) {
            $fileinfo->setPath($header['extradata']['utf8path']);
        } else {
            $fileinfo->setPath($this->cpToUtf8($header['filename']));
        }

        if(isset($header['extradata']['utf8comment'])) {
            $fileinfo->setComment($header['extradata']['utf8comment']);
        } else {
            $fileinfo->setComment($this->cpToUtf8($header['comment']));
        }

        return $fileinfo;
    }
236737
function replace($header)
    {
        if (is_string($header))
            $header = HeaderField::fromString($header);

        return $this
            ->remove($header->getName())
            ->add($header);
    }
1090291
public function getHeader($header) {
		foreach($this->headers as $k => $v) {
			if($v[0] === $header)
				return $v;
		}
	}
937063
protected function sendHeader(string $header, string $content): void
    {
        if (!headers_sent() && self::$sendHeaders) {
            header(sprintf('%s: %s', $header, $content));
        }
    }
270851
public function headers($headers = null)
    {
        if (!func_num_args()) {
            return $this->_headers;
        }
        $this->_headers = $headers;
        return $this;
    }
1120135
public function getAsString($header = null) {

        if (is_null($header)) {

            return array_map([$this, 'headerToString'],
                array_keys($this->headers),
                array_values($this->headers)
            );

        }

        $index = $this->getIndexCaseInsensitive($header);

        return $index === null ? null : self::headerToString($index, $this->headers[$index]);

    }
942018
public function removeHeader($header)
    {
        if (\is_string($header)) {
            if (\array_key_exists($header, $this->_config['headers'])) {
                unset($this->_config['headers'][$header]);
            }
        } else {
            throw new InvalidException('Header must be a string');
        }

        return $this;
    }
374591
private static function parseAuthorizationHeader($header)
    {
        if (strpos($header, 'Basic') !== 0) {
            return false;
        }

        $header = explode(':', base64_decode(substr($header, 6)), 2);

        return [
            'username' => $header[0],
            'password' => isset($header[1]) ? $header[1] : null,
        ];
    }
1010385
public function setHeader($header = null)
    {
        if (is_null($header) && $this->getMethod() == "POST") {
            $host = $this->getHost();

            $header = [];
            $header[] = 'POST /cgi-bin/webscr HTTP/1.1';
            $header[] = 'Content-Type: application/x-www-form-urlencoded';
            if (isset($host)) {
                $header[] = 'Host: ' . $host;
            }
            $header[] = 'Connection: close';
        }
        $this->_aHeader = $header;
    }
651870
public function get_response_header($header = null)
    {
        if ($header) {
            return $this->response_headers[strtolower($header)];
        }
        return $this->response_headers;
    }
332890
public function addHeader($header)
    {
        if (is_string($header)) {
            $header = HeaderField::fromString($header);
        }
        $this->headers[] = $header;
        return $this;
    }