UpdateKernel::handle

public UpdateKernel::handle(Request $request, $type = self::MASTER_REQUEST, $catch = TRUE)

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.

Parameters

Request $request A Request instance:

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

bool $catch Whether to catch exceptions or not:

Return value

Response A Response instance

Throws

\Exception When an Exception occurs during processing

Overrides DrupalKernel::handle

File

core/lib/Drupal/Core/Update/UpdateKernel.php, line 56

Class

UpdateKernel
Defines a kernel which is used primarily to run the update of Drupal.

Namespace

Drupal\Core\Update

Code

public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = TRUE) {
  try {
    static::bootEnvironment();

    // First boot up basic things, like loading the include files.
    $this->initializeSettings($request);
    $this->boot();
    $container = $this->getContainer();
    /** @var \Symfony\Component\HttpFoundation\RequestStack $request_stack */
    $request_stack = $container->get('request_stack');
    $request_stack->push($request);
    $this->preHandle($request);

    // Handle the actual request. We need the session both for authentication
    // as well as the DB update, like
    // \Drupal\system\Controller\DbUpdateController::batchFinished.
    $this->bootSession($request, $type);
    $result = $this->handleRaw($request);
    $this->shutdownSession($request);

    return $result;
  }
  catch (\Exception $e) {
    return $this->handleException($e, $request, $type);
  }
}
doc_Drupal
2016-10-29 09:50:45
Comments
Leave a Comment

Please login to continue.