You are here

public function DrupalKernel::preHandle in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/DrupalKernel.php \Drupal\Core\DrupalKernel::preHandle()

Helper method that does request related initialization.

Parameters

\Symfony\Component\HttpFoundation\Request $request: The current request.

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
Handles a Request to convert it to a Response.

File

core/lib/Drupal/Core/DrupalKernel.php, line 524
Contains \Drupal\Core\DrupalKernel.

Class

DrupalKernel
The DrupalKernel class is the core of Drupal itself.

Namespace

Drupal\Core

Code

public function preHandle(Request $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;
}