ResponseBridge
class ResponseBridge
Constants
| protected FORBIDDEN_TRAILER_NAMES |
Trailer fields that cannot be emitted safely as HTTP trailers. |
Methods
Send an HttpFoundation response through Swoole.
Send status code, headers, and cookies to Swoole.
Send a prepared binary file response.
Read the prepared BinaryFileResponse state Symfony does not expose.
Stream a prepared binary response through checked bounded writes.
Announce the trailer names known before response emission.
Normalize and validate response trailer names.
Normalize and validate one response trailer name.
Stream a Symfony StreamedResponse through Swoole's write() method.
Stream retained iterable chunks directly through Swoole.
Stream retained iterable chunks with one-chunk trailer lookahead.
Stream a trailer-bearing callback response through an output buffer.
Restore removable output buffers after streamed response production.
Delete a binary response file.
Complete a response and require native success.
Send a response file and require native success.
Details
at line 41
static void
send(Response $response, Response $swooleResponse, bool $withBody = true, string $protocol = 'HTTP/1.1', Request|null $request = null)
Send an HttpFoundation response through Swoole.
at line 99
static protected void
sendStatusAndHeaders(Response $response, Response $swooleResponse)
Send status code, headers, and cookies to Swoole.
at line 136
static protected void
sendBinaryFile(BinaryFileResponse $response, Response $swooleResponse, bool $withBody, string $protocol, Request|null $request)
Send a prepared binary file response.
at line 236
static protected array
binaryFileState(BinaryFileResponse $response)
Read the prepared BinaryFileResponse state Symfony does not expose.
at line 273
static protected void
streamBinaryFile(BinaryFileResponse $response, Response $swooleResponse, array $state)
Stream a prepared binary response through checked bounded writes.
at line 369
static protected void
announceTrailers(Response $response)
Announce the trailer names known before response emission.
at line 399
static protected void
sendTrailers(HasTrailers $response, Response $swooleResponse)
Send the final response trailers.
at line 436
static protected array
normalizeTrailerNames(array $names)
Normalize and validate response trailer names.
at line 462
static protected string
normalizeTrailerName(string $name)
Normalize and validate one response trailer name.
at line 495
static protected void
sendStreamedContent(StreamedResponse $response, Response $swooleResponse)
Stream a Symfony StreamedResponse through Swoole's write() method.
Retained iterables are consumed directly so a failed write stops their producer. Ordinary callbacks use echo, so their output is routed through a non-throwing output-buffer handler instead.
The chunk_size of 1 means the buffer flushes after every output
operation that produces 1+ bytes (not per byte). A single
echo "data: ...\n\n" triggers one write() call with the full string.
Removable output buffers are cleaned without spinning on a non-removable user buffer before the earliest callback, write, or end failure is rethrown.
at line 551
static protected bool
sendIterableContent(IterableStreamedResponse $response, Response $swooleResponse)
Stream retained iterable chunks directly through Swoole.
at line 588
static protected bool
sendTrailerIterableContent(IterableStreamedResponse&HasTrailers $response, Response $swooleResponse)
Stream retained iterable chunks with one-chunk trailer lookahead.
at line 632
static protected void
sendTrailerStreamedContent(StreamedResponse&HasTrailers $response, Response $swooleResponse)
Stream a trailer-bearing callback response through an output buffer.
at line 708
static protected void
restoreOutputBufferLevel(int $level)
Restore removable output buffers after streamed response production.
at line 724
static protected bool
deleteBinaryFile(string $path)
Delete a binary response file.
at line 732
static protected void
end(Response $swooleResponse, string|null $content = null)
Complete a response and require native success.
at line 746
static protected void
sendFile(Response $swooleResponse, string $path, int $offset, int $maxlen)
Send a response file and require native success.