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

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

SessionListener.php

Zuletzt modifiziert: 09.10.2024, 12:56 - Dateigröße: 1.32 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\Event\GetResponseEvent;
15  use Symfony\Component\HttpKernel\KernelEvents;
16  use Symfony\Component\EventDispatcher\EventSubscriberInterface;
17   
18  /**
19   * Sets the session in the request.
20   *
21   * @author Johannes M. Schmitt <schmittjoh@gmail.com>
22   */
23  abstract class SessionListener implements EventSubscriberInterface
24  {
25      public function onKernelRequest(GetResponseEvent $event)
26      {
27          if (!$event->isMasterRequest()) {
28              return;
29          }
30   
31          $request = $event->getRequest();
32          $session = $this->getSession();
33          if (null === $session || $request->hasSession()) {
34              return;
35          }
36   
37          $request->setSession($session);
38      }
39   
40      public static function getSubscribedEvents()
41      {
42          return array(
43              KernelEvents::REQUEST => array('onKernelRequest', 128),
44          );
45      }
46   
47      /**
48       * Gets the session object.
49       *
50       * @return SessionInterface|null A SessionInterface instance or null if no session is available
51       */
52      abstract protected function getSession();
53  }
54