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