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. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
ResponseListener.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\HttpKernelInterface;
16 use Symfony\Component\HttpKernel\KernelEvents;
17 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
18
19 /**
20 * ResponseListener fixes the Response headers based on the Request.
21 *
22 * @author Fabien Potencier <fabien@symfony.com>
23 */
24 class ResponseListener implements EventSubscriberInterface
25 {
26 private $charset;
27
28 public function __construct($charset)
29 {
30 $this->charset = $charset;
31 }
32
33 /**
34 * Filters the Response.
35 *
36 * @param FilterResponseEvent $event A FilterResponseEvent instance
37 */
38 public function onKernelResponse(FilterResponseEvent $event)
39 {
40 if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
41 return;
42 }
43
44 $response = $event->getResponse();
45
46 if (null === $response->getCharset()) {
47 $response->setCharset($this->charset);
48 }
49
50 $response->prepare($event->getRequest());
51 }
52
53 public static function getSubscribedEvents()
54 {
55 return array(
56 KernelEvents::RESPONSE => 'onKernelResponse',
57 );
58 }
59 }
60