PHP 클래스 SimpleHttpResponse, simpletest

상속: extends SimpleStickyError
파일 보기 프로젝트 열기: simpletest/simpletest 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( SimpleSocket $socket, SimpleUrl $url, mixed $encoding ) Constructor. Reads and parses the incoming content and headers.
getContent ( ) : string Accessor for the content after the last header line.
getHeaders ( ) : SimpleHttpHeaders Accessor for header block. The response is the combination of this and the content.
getMethod ( ) : string Original request method.
getNewCookies ( ) : array Accessor for any new cookies.
getRequestData ( ) : mixed Original request data.
getSent ( ) : string Raw request that was sent down the wire.
getUrl ( ) : SimpleUrl Resource name.

보호된 메소드들

메소드 설명
isLastPacket ( string $packet ) : boolean Test to see if the packet from the socket is the last one.
parse ( string $raw ) Splits up the headers and the rest of the content.
readAll ( SimpleSocket $socket ) : string Reads the whole of the socket output into a single string.

메소드 상세

__construct() 공개 메소드

Constructor. Reads and parses the incoming content and headers.
public __construct ( SimpleSocket $socket, SimpleUrl $url, mixed $encoding )
$socket SimpleSocket Network connection to fetch response text from.
$url SimpleUrl Resource name.
$encoding mixed Record of content sent.

getContent() 공개 메소드

Accessor for the content after the last header line.
public getContent ( ) : string
리턴 string All content.

getHeaders() 공개 메소드

Accessor for header block. The response is the combination of this and the content.
public getHeaders ( ) : SimpleHttpHeaders
리턴 SimpleHttpHeaders Wrapped header block.

getMethod() 공개 메소드

Original request method.
public getMethod ( ) : string
리턴 string GET, POST or HEAD.

getNewCookies() 공개 메소드

Accessor for any new cookies.
public getNewCookies ( ) : array
리턴 array List of new cookies.

getRequestData() 공개 메소드

Original request data.
public getRequestData ( ) : mixed
리턴 mixed Sent content.

getSent() 공개 메소드

Raw request that was sent down the wire.
public getSent ( ) : string
리턴 string Bytes actually sent.

getUrl() 공개 메소드

Resource name.
public getUrl ( ) : SimpleUrl
리턴 SimpleUrl Current url.

isLastPacket() 보호된 메소드

Test to see if the packet from the socket is the last one.
protected isLastPacket ( string $packet ) : boolean
$packet string Chunk to interpret.
리턴 boolean True if empty or EOF.

parse() 보호된 메소드

Splits up the headers and the rest of the content.
protected parse ( string $raw )
$raw string Content to parse.

readAll() 보호된 메소드

Reads the whole of the socket output into a single string.
protected readAll ( SimpleSocket $socket ) : string
$socket SimpleSocket Unread socket.
리턴 string Raw output if successful else false.