Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DrupalKernel.php

function DrupalKernel::preHandle

Overrides DrupalKernelInterface::preHandle

1 call to DrupalKernel::preHandle()
UpdateKernel::handle in core/lib/Drupal/Core/Update/UpdateKernel.php
Handles a Request to convert it to a Response.

File

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

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_INPUT_SAFE_KEYS, []), (bool) Settings::get(RequestSanitizer::SANITIZE_LOG, FALSE));
    // Ensure that there is a session on every request.
    if (!$request->hasSession()) {
        $this->initializeEphemeralSession($request);
    }
    $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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal