public static function createResponseFromString($str)
    {
        $parts       = preg_split('!(\r?\n){2}!m', $str, 2);
        $headerLines = explode("\n", $parts[0]);
        $response    = new HTTP_Request2_Response(array_shift($headerLines));
        foreach ($headerLines as $headerLine) {
            $response->parseHeaderLine($headerLine);
        }
        $response->parseHeaderLine('');
        if (isset($parts[1])) {
            $response->appendBody($parts[1]);
        }
        return $response;
    }
public static function createResponseFromString($str)
    {
        $parts       = preg_split('!(\r?\n){2}!m', $str, 2);
        $headerLines = explode("\n", $parts[0]);
        $response    = new HTTP_Request2_Response(array_shift($headerLines));
        foreach ($headerLines as $headerLine) {
            $response->parseHeaderLine($headerLine);
        }
        $response->parseHeaderLine('');
        if (isset($parts[1])) {
            $response->appendBody($parts[1]);
        }
        return $response;
    }
public static function createResponseFromString ( $ str ) { $ parts = preg_split ( '!(\r?\n){2}!m' , $ str , 2 ) ; $ headerLines = explode ( "\n" , $ parts [ 0 ] ) ; $ response = new HTTP_Request2_Response ( array_shift ( $ headerLines ) ) ; foreach ( $ headerLines as $ headerLine ) { $ response -> parseHeaderLine ( $ headerLine ) ; } $ response -> parseHeaderLine ( '' ) ; if ( isset ( $ parts [ 1 ] ) ) { $ response -> appendBody ( $ parts [ 1 ] ) ; } return $ response ; }
Creates a new HTTP_Request2_Response object from a string

@param string $str string containing HTTP response message

@return   HTTP_Request2_Response
@throws   HTTP_Request2_Exception
Creates a new HTTP_Request2_Response object from a string