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. |
|
(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\ContainerAwareEventDispatcher;
17 use Symfony\Component\EventDispatcher\Event;
18
19 /**
20 * Extension of the Symfony2 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 ContainerAwareEventDispatcher 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 = array())
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 return parent::dispatch($eventName, $event);
61 }
62
63 /**
64 * {@inheritdoc}
65 */
66 public function disable()
67 {
68 $this->disabled = true;
69 }
70
71 /**
72 * {@inheritdoc}
73 */
74 public function enable()
75 {
76 $this->disabled = false;
77 }
78 }
79