function DrupalKernel::preHandle

Same name in other branches
  1. 9 core/lib/Drupal/Core/DrupalKernel.php \Drupal\Core\DrupalKernel::preHandle()
  2. 10 core/lib/Drupal/Core/DrupalKernel.php \Drupal\Core\DrupalKernel::preHandle()
  3. 11.x core/lib/Drupal/Core/DrupalKernel.php \Drupal\Core\DrupalKernel::preHandle()

Overrides DrupalKernelInterface::preHandle

2 calls to DrupalKernel::preHandle()
DrupalKernel::prepareLegacyRequest in core/lib/Drupal/Core/DrupalKernel.php
Prepare the kernel for handling a request without handling the request.
UpdateKernel::handle in core/lib/Drupal/Core/Update/UpdateKernel.php

File

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

Class

DrupalKernel
The DrupalKernel class is the core of Drupal itself.

Namespace

Drupal\Core

Code

public function preHandle(Request $request) {
    // Sanitize the request.
    $request = RequestSanitizer::sanitize($request, (array) Settings::get(RequestSanitizer::SANITIZE_WHITELIST, []), (bool) Settings::get(RequestSanitizer::SANITIZE_LOG, FALSE));
    $this->loadLegacyIncludes();
    // Load all enabled modules.
    $this->container
        ->get('module_handler')
        ->loadAll();
    // Register stream wrappers.
    $this->container
        ->get('stream_wrapper_manager')
        ->register();
    // Initialize legacy request globals.
    $this->initializeRequestGlobals($request);
    // Put the request on the stack.
    $this->container
        ->get('request_stack')
        ->push($request);
    // Set the allowed protocols.
    UrlHelper::setAllowedProtocols($this->container
        ->getParameter('filter_protocols'));
    // Override of Symfony's MIME type guesser singleton.
    MimeTypeGuesser::registerWithSymfonyGuesser($this->container);
    $this->prepared = TRUE;
}

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