src/Kernel.php
public function dispatchRequest(Request $request, Response $response, Table $table)
    {
        $requestProcessor = new RequestProcessor($this->container);
        $actionResponse = $requestProcessor->process($request, $response, $table);

        if (!$actionResponse->isSent()) {
            $response->header("Content-Type", $actionResponse->getContentType());

            $contentBlocks = str_split($actionResponse->getBody(), 2046 * 1024);
            foreach ($contentBlocks as $block) {
                $response->write($block);
            }

            $response->end();
        }
    }
public function dispatchRequest(Request $request, Response $response, Table $table)
    {
        $requestProcessor = new RequestProcessor($this->container);
        $actionResponse = $requestProcessor->process($request, $response, $table);

        if (!$actionResponse->isSent()) {
            $response->header("Content-Type", $actionResponse->getContentType());

            $contentBlocks = str_split($actionResponse->getBody(), 2046 * 1024);
            foreach ($contentBlocks as $block) {
                $response->write($block);
            }

            $response->end();
        }
    }
在 onRequest 回调事件中的处理函数
@param Request $request
@param Response $response
@param Table $table
@return mixed|void