Skip to content

SapiStreamEmitter

  • Full name: \Qubus\Http\Emitter\SapiStreamEmitter
  • Parent class: \Qubus\Http\Emitter\BaseEmitter
  • This class is marked as final and can't be subclassed
  • This class is a Final class

Constants

Constant Visibility Type Value
CONTENT_PATTERN_REGEX private '/(?P<unit>[\w]+)\s+(?P<start>\d+)-(?P<end>\d+)/(?P<size>\d+

Properties

maxBufferSize

Maximum output buffering size for each iteration.

protected int $maxBufferSize

Methods

getMaxBufferSize

Get the value of max buffer size

public getMaxBufferSize(): int

setMaxBufferSize

Set the value of max buffer size

public setMaxBufferSize(int $maxBufferSize): \Qubus\Http\Emitter\SapiStreamEmitter

Parameters:

Parameter Type Description
$maxBufferSize int

Throws:


emit

Emit a response.

public emit(\Psr\Http\Message\ResponseInterface $response): void

Parameters:

Parameter Type Description
$response \Psr\Http\Message\ResponseInterface

emitStream

Emit response body as a stream

private emitStream(\Psr\Http\Message\ResponseInterface $response): void

Parameters:

Parameter Type Description
$response \Psr\Http\Message\ResponseInterface

emitBody

Emit the response body by max buffer size

private emitBody(\Psr\Http\Message\ResponseInterface $response): void

Parameters:

Parameter Type Description
$response \Psr\Http\Message\ResponseInterface

emitBodyRange

Emit the range of the response body by max buffer size.

private emitBodyRange(\Psr\Http\Message\ResponseInterface $response, \Qubus\Http\Emitter\ContentRange $range): void

Parameters:

Parameter Type Description
$response \Psr\Http\Message\ResponseInterface
$range \Qubus\Http\Emitter\ContentRange

getContentRange

Get ContentRange

private getContentRange(\Psr\Http\Message\ResponseInterface $response): \Qubus\Http\Emitter\ContentRange|null

Parses the Content-Range header line from the response and generates ContentRange instance.

Parameters:

Parameter Type Description
$response \Psr\Http\Message\ResponseInterface

See Also:

  • http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.16 -

Inherited methods

assertNoPreviousOutput

Assert either that no headers have been sent or the output buffer contains no content.

protected assertNoPreviousOutput(): void

emitStatusLine

Emit the status line.

protected emitStatusLine(\Psr\Http\Message\ResponseInterface $response): void

Emits the status line using the protocol version and status code from the response; if a reason phrase is available, it, too, is emitted.

Parameters:

Parameter Type Description
$response \Psr\Http\Message\ResponseInterface

emitHeaders

Emit response headers.

protected emitHeaders(\Psr\Http\Message\ResponseInterface $response): void

Loops through each header, emitting each; if the header value is an array with multiple values, ensures that each is sent in such a way as to create aggregate headers (instead of replace the previous).

Parameters:

Parameter Type Description
$response \Psr\Http\Message\ResponseInterface

normalizeHeaderName

Normalize a header name

private normalizeHeaderName(string $headerName): string

Normalized header will be in the following format: Example-Header-Name

Parameters:

Parameter Type Description
$headerName string

private header(string $headerName, bool $replace, int $statusCode): void

Parameters:

Parameter Type Description
$headerName string
$replace bool
$statusCode int

closeConnection

protected closeConnection(): void

emit

Emit a response.

public emit(\Psr\Http\Message\ResponseInterface $response): void
  • This method is abstract.

Parameters:

Parameter Type Description
$response \Psr\Http\Message\ResponseInterface


Automatically generated on 2025-10-13