Verzeichnisstruktur phpBB-3.2.0
- Veröffentlicht
- 06.01.2017
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
SurrogateListener.php
01 <?php
02
03 /*
04 * This file is part of the Symfony package.
05 *
06 * (c) Fabien Potencier <fabien@symfony.com>
07 *
08 * For the full copyright and license information, please view the LICENSE
09 * file that was distributed with this source code.
10 */
11
12 namespace Symfony\Component\HttpKernel\EventListener;
13
14 use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
15 use Symfony\Component\HttpKernel\HttpCache\SurrogateInterface;
16 use Symfony\Component\HttpKernel\KernelEvents;
17 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
18
19 /**
20 * SurrogateListener adds a Surrogate-Control HTTP header when the Response needs to be parsed for Surrogates.
21 *
22 * @author Fabien Potencier <fabien@symfony.com>
23 */
24 class SurrogateListener implements EventSubscriberInterface
25 {
26 private $surrogate;
27
28 /**
29 * Constructor.
30 *
31 * @param SurrogateInterface $surrogate An SurrogateInterface instance
32 */
33 public function __construct(SurrogateInterface $surrogate = null)
34 {
35 $this->surrogate = $surrogate;
36 }
37
38 /**
39 * Filters the Response.
40 *
41 * @param FilterResponseEvent $event A FilterResponseEvent instance
42 */
43 public function onKernelResponse(FilterResponseEvent $event)
44 {
45 if (!$event->isMasterRequest() || null === $this->surrogate) {
46 return;
47 }
48
49 $this->surrogate->addSurrogateControl($event->getResponse());
50 }
51
52 public static function getSubscribedEvents()
53 {
54 return array(
55 KernelEvents::RESPONSE => 'onKernelResponse',
56 );
57 }
58 }
59