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

EventDataCollector.php

Zuletzt modifiziert: 09.10.2024, 12:56 - Dateigröße: 2.62 KiB


001  <?php
002   
003  /*
004   * This file is part of the Symfony package.
005   *
006   * (c) Fabien Potencier <fabien@symfony.com>
007   *
008   * For the full copyright and license information, please view the LICENSE
009   * file that was distributed with this source code.
010   */
011   
012  namespace Symfony\Component\HttpKernel\DataCollector;
013   
014  use Symfony\Component\HttpFoundation\Request;
015  use Symfony\Component\HttpFoundation\Response;
016  use Symfony\Component\EventDispatcher\EventDispatcherInterface;
017  use Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcherInterface;
018   
019  /**
020   * EventDataCollector.
021   *
022   * @author Fabien Potencier <fabien@symfony.com>
023   */
024  class EventDataCollector extends DataCollector implements LateDataCollectorInterface
025  {
026      protected $dispatcher;
027   
028      public function __construct(EventDispatcherInterface $dispatcher = null)
029      {
030          $this->dispatcher = $dispatcher;
031      }
032   
033      /**
034       * {@inheritdoc}
035       */
036      public function collect(Request $request, Response $response, \Exception $exception = null)
037      {
038          $this->data = array(
039              'called_listeners' => array(),
040              'not_called_listeners' => array(),
041          );
042      }
043   
044      public function lateCollect()
045      {
046          if ($this->dispatcher instanceof TraceableEventDispatcherInterface) {
047              $this->setCalledListeners($this->dispatcher->getCalledListeners());
048              $this->setNotCalledListeners($this->dispatcher->getNotCalledListeners());
049          }
050      }
051   
052      /**
053       * Sets the called listeners.
054       *
055       * @param array $listeners An array of called listeners
056       *
057       * @see TraceableEventDispatcherInterface
058       */
059      public function setCalledListeners(array $listeners)
060      {
061          $this->data['called_listeners'] = $listeners;
062      }
063   
064      /**
065       * Gets the called listeners.
066       *
067       * @return array An array of called listeners
068       *
069       * @see TraceableEventDispatcherInterface
070       */
071      public function getCalledListeners()
072      {
073          return $this->data['called_listeners'];
074      }
075   
076      /**
077       * Sets the not called listeners.
078       *
079       * @param array $listeners An array of not called listeners
080       *
081       * @see TraceableEventDispatcherInterface
082       */
083      public function setNotCalledListeners(array $listeners)
084      {
085          $this->data['not_called_listeners'] = $listeners;
086      }
087   
088      /**
089       * Gets the not called listeners.
090       *
091       * @return array An array of not called listeners
092       *
093       * @see TraceableEventDispatcherInterface
094       */
095      public function getNotCalledListeners()
096      {
097          return $this->data['not_called_listeners'];
098      }
099   
100      /**
101       * {@inheritdoc}
102       */
103      public function getName()
104      {
105          return 'events';
106      }
107  }
108