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 |
dispatcher.php
01 <?php
02 /**
03 *
04 * This file is part of the phpBB Forum Software package.
05 *
06 * @copyright (c) phpBB Limited <https://www.phpbb.com>
07 * @license GNU General Public License, version 2 (GPL-2.0)
08 *
09 * For full copyright and license information, please see
10 * the docs/CREDITS.txt file.
11 *
12 */
13
14 namespace phpbb\event;
15
16 use Symfony\Component\EventDispatcher\EventDispatcher;
17 use Symfony\Component\EventDispatcher\Event;
18
19 /**
20 * Extension of the Symfony EventDispatcher
21 *
22 * It provides an additional `trigger_event` method, which
23 * gives some syntactic sugar for dispatching events. Instead
24 * of creating the event object, the method will do that for
25 * you.
26 *
27 * Example:
28 *
29 * $vars = array('page_title');
30 * extract($phpbb_dispatcher->trigger_event('core.index', compact($vars)));
31 *
32 */
33 class dispatcher extends EventDispatcher implements dispatcher_interface
34 {
35 /**
36 * @var bool
37 */
38 protected $disabled = false;
39
40 /**
41 * {@inheritdoc}
42 */
43 public function trigger_event($eventName, $data = [])
44 {
45 $event = new \phpbb\event\data($data);
46 $this->dispatch($eventName, $event);
47 return $event->get_data_filtered(array_keys($data));
48 }
49
50 /**
51 * {@inheritdoc}
52 */
53 public function dispatch($eventName, Event $event = null)
54 {
55 if ($this->disabled)
56 {
57 return $event;
58 }
59
60 foreach ((array) $eventName as $name)
61 {
62 $event = parent::dispatch($name, $event);
63 }
64
65 return $event;
66 }
67
68 /**
69 * {@inheritdoc}
70 */
71 public function disable()
72 {
73 $this->disabled = true;
74 }
75
76 /**
77 * {@inheritdoc}
78 */
79 public function enable()
80 {
81 $this->disabled = false;
82 }
83 }
84