Chris@0
|
1 <?php
|
Chris@0
|
2
|
Chris@0
|
3 namespace Drupal\Core\StackMiddleware;
|
Chris@0
|
4
|
Chris@0
|
5 use Drupal\Core\DrupalKernelInterface;
|
Chris@0
|
6 use Symfony\Component\HttpFoundation\Request;
|
Chris@0
|
7 use Symfony\Component\HttpKernel\HttpKernelInterface;
|
Chris@0
|
8
|
Chris@0
|
9 /**
|
Chris@0
|
10 * Prepares the environment after page caching ran.
|
Chris@0
|
11 */
|
Chris@0
|
12 class KernelPreHandle implements HttpKernelInterface {
|
Chris@0
|
13
|
Chris@0
|
14 /**
|
Chris@0
|
15 * The wrapped HTTP kernel.
|
Chris@0
|
16 *
|
Chris@0
|
17 * @var \Symfony\Component\HttpKernel\HttpKernelInterface
|
Chris@0
|
18 */
|
Chris@0
|
19 protected $httpKernel;
|
Chris@0
|
20
|
Chris@0
|
21 /**
|
Chris@0
|
22 * The main Drupal kernel.
|
Chris@0
|
23 *
|
Chris@0
|
24 * @var \Drupal\Core\DrupalKernelInterface
|
Chris@0
|
25 */
|
Chris@0
|
26 protected $drupalKernel;
|
Chris@0
|
27
|
Chris@0
|
28 /**
|
Chris@0
|
29 * Constructs a new KernelPreHandle instance.
|
Chris@0
|
30 *
|
Chris@0
|
31 * @param \Symfony\Component\HttpKernel\HttpKernelInterface $http_kernel
|
Chris@0
|
32 * The wrapped HTTP kernel.
|
Chris@0
|
33 * @param \Drupal\Core\DrupalKernelInterface $drupal_kernel
|
Chris@0
|
34 * The main Drupal kernel.
|
Chris@0
|
35 */
|
Chris@0
|
36 public function __construct(HttpKernelInterface $http_kernel, DrupalKernelInterface $drupal_kernel) {
|
Chris@0
|
37 $this->httpKernel = $http_kernel;
|
Chris@0
|
38 $this->drupalKernel = $drupal_kernel;
|
Chris@0
|
39 }
|
Chris@0
|
40
|
Chris@0
|
41 /**
|
Chris@0
|
42 * {@inheritdoc}
|
Chris@0
|
43 */
|
Chris@0
|
44 public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = TRUE) {
|
Chris@0
|
45 $this->drupalKernel->preHandle($request);
|
Chris@0
|
46
|
Chris@0
|
47 return $this->httpKernel->handle($request, $type, $catch);
|
Chris@0
|
48 }
|
Chris@0
|
49
|
Chris@0
|
50 }
|