Verzeichnisstruktur phpBB-3.3.15
- Veröffentlicht
- 28.08.2024
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 |
AddRequestFormatsListener.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\EventDispatcher\EventSubscriberInterface;
15 use Symfony\Component\HttpKernel\Event\GetResponseEvent;
16 use Symfony\Component\HttpKernel\KernelEvents;
17
18 /**
19 * Adds configured formats to each request.
20 *
21 * @author Gildas Quemener <gildas.quemener@gmail.com>
22 */
23 class AddRequestFormatsListener implements EventSubscriberInterface
24 {
25 protected $formats;
26
27 public function __construct(array $formats)
28 {
29 $this->formats = $formats;
30 }
31
32 /**
33 * Adds request formats.
34 */
35 public function onKernelRequest(GetResponseEvent $event)
36 {
37 $request = $event->getRequest();
38 foreach ($this->formats as $format => $mimeTypes) {
39 $request->setFormat($format, $mimeTypes);
40 }
41 }
42
43 /**
44 * {@inheritdoc}
45 */
46 public static function getSubscribedEvents()
47 {
48 return [KernelEvents::REQUEST => ['onKernelRequest', 1]];
49 }
50 }
51