class StreamOutput extends Output (View source)

The StreamOutput class.

Properties

string $headerSent Property headerSent. from Output

Methods

ResponseInterface
respond(ResponseInterface $response, boolean $returnBody = false)

Method to send the application response to the client. All headers will be sent prior to the main application output data.

string
sendBody(ResponseInterface $response)

Send body as response.

header(string $string, boolean $replace = true, integer $code = null)

Method to send a header to the client. We wrap header() function with this method for testing reason.

from Output
sendHeaders(ResponseInterface $response)

Send all response headers.

from Output
void
sendStatusLine(ResponseInterface $response)

Send HTTP status line.

from Output
bool
headersSent()

checkHeaderSent

from Output
int
getMaxBufferLength()

Method to get property MaxBufferLength

setMaxBufferLength(int $maxBufferLength)

Method to set property maxBufferLength

int
getDelay()

Method to get property Delay

setDelay(int $delay)

Method to set property delay

Details

at line line 45
ResponseInterface respond(ResponseInterface $response, boolean $returnBody = false)

Method to send the application response to the client. All headers will be sent prior to the main application output data.

Parameters

ResponseInterface $response Respond body output.
boolean $returnBody Return body as string.

Return Value

ResponseInterface

at line line 59
string sendBody(ResponseInterface $response)

Send body as response.

Parameters

ResponseInterface $response Emmit string to respond.

Return Value

string

in Output at line line 84
Output header(string $string, boolean $replace = true, integer $code = null)

Method to send a header to the client. We wrap header() function with this method for testing reason.

Parameters

string $string The header string.
boolean $replace The optional replace parameter indicates whether the header should replace a previous similar header, or add a second header of the same type.
integer $code Forces the HTTP response code to the specified value. Note that this parameter only has an effect if the string is not empty.

Return Value

Output Return self to support chaining.

See also

header()

in Output at line line 98
Output sendHeaders(ResponseInterface $response)

Send all response headers.

Parameters

ResponseInterface $response Response object to contain headers.

Return Value

Output Instance of $this to allow chaining.

in Output at line line 123
void sendStatusLine(ResponseInterface $response)

Send HTTP status line.

Parameters

ResponseInterface $response Response object to contain status code and protocol version.

Return Value

void

in Output at line line 137
bool headersSent()

checkHeaderSent

Return Value

bool

at line line 159
int getMaxBufferLength()

Method to get property MaxBufferLength

Return Value

int

at line line 171
StreamOutput setMaxBufferLength(int $maxBufferLength)

Method to set property maxBufferLength

Parameters

int $maxBufferLength

Return Value

StreamOutput Return self to support chaining.

at line line 183
int getDelay()

Method to get property Delay

Return Value

int

at line line 195
StreamOutput setDelay(int $delay)

Method to set property delay

Parameters

int $delay

Return Value

StreamOutput Return self to support chaining.