Verzeichnisstruktur phpBB-3.1.0


Veröffentlicht
27.10.2014

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.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

EsiListener.php

Zuletzt modifiziert: 09.10.2024, 12:58 - Dateigröße: 1.49 KiB


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\HttpKernelInterface;
15  use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
16  use Symfony\Component\HttpKernel\KernelEvents;
17  use Symfony\Component\HttpKernel\HttpCache\Esi;
18  use Symfony\Component\EventDispatcher\EventSubscriberInterface;
19   
20  /**
21   * EsiListener adds a Surrogate-Control HTTP header when the Response needs to be parsed for ESI.
22   *
23   * @author Fabien Potencier <fabien@symfony.com>
24   */
25  class EsiListener implements EventSubscriberInterface
26  {
27      private $esi;
28   
29      /**
30       * Constructor.
31       *
32       * @param Esi $esi An ESI instance
33       */
34      public function __construct(Esi $esi = null)
35      {
36          $this->esi = $esi;
37      }
38   
39      /**
40       * Filters the Response.
41       *
42       * @param FilterResponseEvent $event A FilterResponseEvent instance
43       */
44      public function onKernelResponse(FilterResponseEvent $event)
45      {
46          if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType() || null === $this->esi) {
47              return;
48          }
49   
50          $this->esi->addSurrogateControl($event->getResponse());
51      }
52   
53      public static function getSubscribedEvents()
54      {
55          return array(
56              KernelEvents::RESPONSE => 'onKernelResponse',
57          );
58      }
59  }
60