Perform any final actions for the request lifecycle.

@param  \Illuminate\Http\Request                    $request
@param  \Symfony\Component\HttpFoundation\Response  $response
175152
public function terminate(Request $request, Response $response)
    {
        $this->settings->save();

        $unused = compact('request', 'response');
        unset($unused);
    }
1143100
public function executeTerminators(Request $request, Response $response): Response
    {
        $middlewares = $this->filterMiddleware(Terminator::class);

        foreach ($middlewares as $middleware) {
            $response = $middleware->doTerminate($request, $response);
        }

        unset($middlewares);

        return $response;
    }
571186
public function set(&$request, &$response = null)
    {
        $this->request  = $request;
        $this->response = $response;
        return $this;
    }
194062
public function respond(ResponseInterface $response)
    {
        $this->httpClient->respond(
            $response->getStatusCode(),
            $response->getBody()->__toString(),
            $response->getHeaders()
        );
    }
468866
function process_response($request, $response)
    {
        if (! $request->user->isAnonymous()) {
            $request->session->setData($this->session_key, $request->user->id);
        }
        return $response;
    }
160914
public function process(Request $request, Response $response)
    {
        // Conditionally add jQuery
        $this->addJquery($request, $response);

        /** @var FileAssetInterface $asset */
        foreach ($this->sort($this->javascript) as $key => $asset) {
            $this->processAsset($asset, $request, $response);
            unset($this->javascript[$key]);
        }

        /** @var FileAssetInterface $asset */
        foreach ($this->sort($this->stylesheet) as $key => $asset) {
            $this->processAsset($asset, $request, $response);
            unset($this->stylesheet[$key]);
        }
    }
201152
public function dispatch(Request $request, Response $response) {
		$module = ucfirst($request->module);
		$controller = ucfirst($request->controller);
		$action = ucfirst($request->action);
		$response->setTemplate($controller . '/' . $action);
		$response->setTemplatePath(APP_PATH . 'Module/' . $module . '/View/');
		if (!empty($request->extension)) {
			$response->mimeType($request->extension);
		}
		try {
			$code = self::isValid($module, $controller, $action);
			if ($code === self::ROUTE_VALID) {
				$className = EntryUtil::controller($module, $controller);
				$clazz = Container::getInstance()->get($className);
				$actionName = $action . 'Action';
				$result = $clazz->$actionName($request, $response);
				if ($result !== null) {
					$response->result = $result;
				}
			} else {
				// Not found
				$request->status = $code;
			}
		} catch (\Throwable $e) {
			$request->status = $e;
		}
		$this->executeInterceptor('after', $request, $response);
		$request->end();
		$response->end();
		unset($request, $response);
	}
1256103
public function prepareForResponse(Response $response) {
		$this->jsonPayload = new JsonPayload($this->data);
		$this->jsonPayload->prepareForResponse($response);
	}
298525
public function onCaptured(ServiceResponse $response)
    {
        /** @var Reservation $reservation */
        if (($reservation = Reservation::get()->byID($this->owner->ReservationID)) && $reservation->exists()) {
            $reservation->complete();
        }
    }
794688
public function terminate($request, $response)
    {
        if ($this->shouldExecute($request, false)) {
            $this->after($request, $response);
        }

        return;
    }
1133182
public function behave(Response $response)
    {
        return new Response(
            json_decode($response->content(), true),
            $response->contentType(),
            $response->error(),
            $response->errorCode(),
            $response->headerLines(),
            $response->statusCode()
        );
    }
537817
public function sendByResponse(Response $response)
    {
        $this->sendHeaders($response);
        $this->sendBody($response);
        if (function_exists('fastcgi_finish_request')) {
            fastcgi_finish_request();
        } else {
            static::closeOutputBuffers(0, true);
        }
    }
1013103
public function terminate(Request $request, Response $response)
    {
        $this->output->log($request, $response);
    }
212017
public function respond($response)
	{
		if (
			$this->logger !== null &&
			$this->logger->isHandling(Logger::DEBUG)
		) {
			$this->logger->addDebug(
				'Send response',
				array(
					 'content-type' => $this->contentType,
					 'response'     => ctype_print($response) ? $response : 'base64:' . base64_encode($response)
				)
			);
		}

		ob_start();
		while (ob_end_clean()) {
		}
		header('Content-Type: ' . $this->contentType);
		echo $response;
	}
1201172
protected function updateResponse(Request $request, Response $response)
    {
        $this->stopProfiling(ProfilingCollection::REQUEST_TIMER);

        if ($this->needToUpdateResponse($response)) {
            $data = $this->getResponseData($response);

            if ($data === false) {
                return;
            }

            $data[$this->responseKey] = $this->storage->getData();

            $this->setResponseData($response, $data);
        }
    }
687363
public function resolve(ResponseInterface $response): void
    {
        if (Promise::PENDING !== $this->state) {
            return;
        }

        $this->value = $response;
        $this->state = Promise::FULFILLED;

        foreach ($this->onFulfilledCallbacks as $onFulfilledCallback) {
            $onFulfilledCallback($response);
        }
    }
903678
public function execute(Framework $framework, RequestAbstract $request, Response $response)
    {
        $this->templatesManager->addRenderer($this->htmlRenderer);
    }