public function HttpKernel::handle

Same name in this branch

Handles a Request to convert it to a Response.

When $catch is true, the implementation must catch all exceptions and do its best to convert them to a Response instance.

@api

Parameters

Request $request A Request instance:

integer $type The type of the request: (one of HttpKernelInterface::MASTER_REQUEST or HttpKernelInterface::SUB_REQUEST)

Boolean $catch Whether to catch exceptions or not:

Return value

Response A Response instance

Throws

\Exception When an Exception occurs during processing

Overrides HttpKernelInterface::handle

3 calls to HttpKernel::handle()
HttpKernel::handle in drupal/core/lib/Drupal/Core/HttpKernel.php
Handles a Request to convert it to a Response.
TestHttpKernel::handle in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/TestHttpKernel.php
Handles a Request to convert it to a Response.
TestMultipleHttpKernel::handle in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/TestMultipleHttpKernel.php
Handles a Request to convert it to a Response.
3 methods override HttpKernel::handle()
HttpKernel::handle in drupal/core/lib/Drupal/Core/HttpKernel.php
Handles a Request to convert it to a Response.
TestHttpKernel::handle in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/TestHttpKernel.php
Handles a Request to convert it to a Response.
TestMultipleHttpKernel::handle in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/TestMultipleHttpKernel.php
Handles a Request to convert it to a Response.

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php, line 70

Class

HttpKernel
HttpKernel notifies events to convert a Request object to a Response one.

Namespace

Symfony\Component\HttpKernel

Code

public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) {
  try {
    return $this
      ->handleRaw($request, $type);
  } catch (\Exception $e) {
    if (false === $catch) {
      throw $e;
    }
    return $this
      ->handleException($e, $request, $type);
  }
}