function UpdateKernel::handle

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Update/UpdateKernel.php \Drupal\Core\Update\UpdateKernel::handle()
  2. 8.9.x core/lib/Drupal/Core/Update/UpdateKernel.php \Drupal\Core\Update\UpdateKernel::handle()
  3. 11.x core/lib/Drupal/Core/Update/UpdateKernel.php \Drupal\Core\Update\UpdateKernel::handle()

Overrides DrupalKernel::handle

File

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

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::MAIN_REQUEST, $catch = TRUE) : Response {
  try {
    static::bootEnvironment();
    // First boot up basic things, like loading the include files.
    $this->initializeSettings($request);
    ReverseProxyMiddleware::setSettingsOnRequest($request, Settings::getInstance());
    $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);
    $result = $this->handleRaw($request);
    $this->shutdownSession($request);
    return $result;
  } catch (\Exception $e) {
    return $this->handleException($e, $request, $type);
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.