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

Breadcrumb

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

class KernelPreHandle

Prepares the environment after page caching ran.

Hierarchy

  • class \Drupal\Core\StackMiddleware\KernelPreHandle implements \Symfony\Component\HttpKernel\HttpKernelInterface

Expanded class hierarchy of KernelPreHandle

File

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

Namespace

Drupal\Core\StackMiddleware
View source
class KernelPreHandle implements HttpKernelInterface {
    
    /**
     * The wrapped HTTP kernel.
     *
     * @var \Symfony\Component\HttpKernel\HttpKernelInterface
     */
    protected $httpKernel;
    
    /**
     * The main Drupal kernel.
     *
     * @var \Drupal\Core\DrupalKernelInterface
     */
    protected $drupalKernel;
    
    /**
     * Constructs a new KernelPreHandle instance.
     *
     * @param \Symfony\Component\HttpKernel\HttpKernelInterface $http_kernel
     *   The wrapped HTTP kernel.
     * @param \Drupal\Core\DrupalKernelInterface $drupal_kernel
     *   The main Drupal kernel.
     */
    public function __construct(HttpKernelInterface $http_kernel, DrupalKernelInterface $drupal_kernel) {
        $this->httpKernel = $http_kernel;
        $this->drupalKernel = $drupal_kernel;
    }
    
    /**
     * {@inheritdoc}
     */
    public function handle(Request $request, $type = self::MAIN_REQUEST, $catch = TRUE) : Response {
        $this->drupalKernel
            ->preHandle($request);
        return $this->httpKernel
            ->handle($request, $type, $catch);
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
HttpKernelInterface::MAIN_REQUEST public constant
HttpKernelInterface::SUB_REQUEST public constant
KernelPreHandle::$drupalKernel protected property The main Drupal kernel.
KernelPreHandle::$httpKernel protected property The wrapped HTTP kernel.
KernelPreHandle::handle public function Handles a Request to convert it to a Response. Overrides HttpKernelInterface::handle
KernelPreHandle::__construct public function Constructs a new KernelPreHandle instance.

API Navigation

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