W3cubDocs

/Drupal 8

public function DrupalKernel::terminate

public DrupalKernel::terminate(Request $request, Response $response)

Terminates a request/response cycle.

Should be called after sending the response and before shutting down the kernel.

Parameters

Request $request A Request instance:

Response $response A Response instance:

Overrides TerminableInterface::terminate

File

core/lib/Drupal/Core/DrupalKernel.php, line 598

Class

DrupalKernel
The DrupalKernel class is the core of Drupal itself.

Namespace

Drupal\Core

Code

public function terminate(Request $request, Response $response) {
  // Only run terminate() when essential services have been set up properly
  // by preHandle() before.
  if (FALSE === $this->prepared) {
    return;
  }

  if ($this->getHttpKernel() instanceof TerminableInterface) {
    $this->getHttpKernel()->terminate($request, $response);
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!DrupalKernel.php/function/DrupalKernel::terminate/8.1.x