function KernelPreHandle::handle

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

File

core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php, line 25

Class

KernelPreHandle
Prepares the environment after page caching ran.

Namespace

Drupal\Core\StackMiddleware

Code

public function handle(Request $request, $type = self::MAIN_REQUEST, $catch = TRUE) : Response {
  // \Drupal\Core\DrupalKernel::preHandle() pushes requests to the stack.
  $this->drupalKernel
    ->preHandle($request);
  try {
    return $this->httpKernel
      ->handle($request, $type, $catch);
  } finally {
    // Main requests are popped in \Drupal\Core\DrupalKernel::terminate().
    if ($type !== self::MAIN_REQUEST) {
      $this->requestStack
        ->pop();
    }
  }
}

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