Doctrine\OrientDB\Binding\Client\Http\CurlClientResponse::buildHeaders PHP Method

buildHeaders() protected method

Builds headers array from a well-formatted string.
protected buildHeaders ( string $headers )
$headers string
    protected function buildHeaders($headers)
    {
        $parts = explode("\r\n", $headers);
        $status = array_shift($parts);
        $statusParts = explode(' ', $status);
        if (array_key_exists(0, $statusParts)) {
            $this->setProtocol($statusParts[0]);
        }
        if (array_key_exists(1, $statusParts)) {
            $this->setStatusCode($statusParts[1]);
        }
        foreach ($parts as $header) {
            list($header, $value) = explode(':', $header, 2);
            $header = trim($header, ' ');
            if (isset($this->headers[$header])) {
                $this->headers[$header] .= "," . $value;
            } else {
                $this->headers[$header] = trim($value, ' ');
            }
        }
    }