public static function parseHeaders($content, AbstractMessage $message)
    {
        $namespace = explode('\\', get_class($message));
        $name = strtoupper(array_pop($namespace));

        if (strpos($content, 'HTTP/') === 0 || strpos($content, $name) === 0) {
            $line = self::nibbleLine($content);
            if (preg_match('/^HTTP\/[0-9]{1}\.[0-9]{1} (?P<code>[0-9]+) (?P<message>.*)$/', $line, $matches) &&
                $matches["code"] == "100"
            ) {
                self::nibbleLine($content);
            }
            while (($line = self::nibbleLine($content)) != "") {
                if (preg_match('/^([A-Za-z\-]+): (.*)/', $line, $matches)) {
                    $message->addHeader($matches[1], $matches[2]);
                }
            }
        }

        return $content;
    }
public static function parseHeaders($content, AbstractMessage $message)
    {
        $namespace = explode('\\', get_class($message));
        $name = strtoupper(array_pop($namespace));

        if (strpos($content, 'HTTP/') === 0 || strpos($content, $name) === 0) {
            $line = self::nibbleLine($content);
            if (preg_match('/^HTTP\/[0-9]{1}\.[0-9]{1} (?P<code>[0-9]+) (?P<message>.*)$/', $line, $matches) &&
                $matches["code"] == "100"
            ) {
                self::nibbleLine($content);
            }
            while (($line = self::nibbleLine($content)) != "") {
                if (preg_match('/^([A-Za-z\-]+): (.*)/', $line, $matches)) {
                    $message->addHeader($matches[1], $matches[2]);
                }
            }
        }

        return $content;
    }
public static function parseHeaders ( $ content , AbstractMessage $ message ) { $ namespace = explode ( '\\' , get_class ( $ message ) ) ; $ name = strtoupper ( array_pop ( $ namespace ) ) ; if ( strpos ( $ content , 'HTTP/' ) === 0 || strpos ( $ content , $ name ) === 0 ) { $ line = self :: nibbleLine ( $ content ) ; if ( preg_match ( '/^HTTP\/[0-9]{1}\.[0-9]{1} (?P<code>[0-9]+) (?P<message>.*)$/' , $ line , $ matches ) && $ matches [ "code" ] == "100" ) { self :: nibbleLine ( $ content ) ; } while ( ( $ line = self :: nibbleLine ( $ content ) ) != "" ) { if ( preg_match ( '/^([A-Za-z\-]+): (.*)/' , $ line , $ matches ) ) { $ message -> addHeader ( $ matches [ 1 ] , $ matches [ 2 ] ) ; } } } return $ content ; }
Parse headers from content and populate response with it
@param string $content
@param \Bee4\Transport\Message\AbstractMessage $message
@return string
Parse headers from content and populate response with it