public function DrupalKernel::preHandle in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/DrupalKernel.php \Drupal\Core\DrupalKernel::preHandle()
- 9 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
File
- core/
lib/ Drupal/ Core/ DrupalKernel.php, line 546
Class
- DrupalKernel
- The DrupalKernel class is the core of Drupal itself.
Namespace
Drupal\CoreCode
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));
$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'));
$this->prepared = TRUE;
}