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 |
FlashBag.php
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\HttpFoundation\Session\Flash;
013
014 /**
015 * FlashBag flash message container.
016 *
017 * @author Drak <drak@zikula.org>
018 */
019 class FlashBag implements FlashBagInterface
020 {
021 private $name = 'flashes';
022 private $flashes = [];
023 private $storageKey;
024
025 /**
026 * @param string $storageKey The key used to store flashes in the session
027 */
028 public function __construct($storageKey = '_symfony_flashes')
029 {
030 $this->storageKey = $storageKey;
031 }
032
033 /**
034 * {@inheritdoc}
035 */
036 public function getName()
037 {
038 return $this->name;
039 }
040
041 public function setName($name)
042 {
043 $this->name = $name;
044 }
045
046 /**
047 * {@inheritdoc}
048 */
049 public function initialize(array &$flashes)
050 {
051 $this->flashes = &$flashes;
052 }
053
054 /**
055 * {@inheritdoc}
056 */
057 public function add($type, $message)
058 {
059 $this->flashes[$type][] = $message;
060 }
061
062 /**
063 * {@inheritdoc}
064 */
065 public function peek($type, array $default = [])
066 {
067 return $this->has($type) ? $this->flashes[$type] : $default;
068 }
069
070 /**
071 * {@inheritdoc}
072 */
073 public function peekAll()
074 {
075 return $this->flashes;
076 }
077
078 /**
079 * {@inheritdoc}
080 */
081 public function get($type, array $default = [])
082 {
083 if (!$this->has($type)) {
084 return $default;
085 }
086
087 $return = $this->flashes[$type];
088
089 unset($this->flashes[$type]);
090
091 return $return;
092 }
093
094 /**
095 * {@inheritdoc}
096 */
097 public function all()
098 {
099 $return = $this->peekAll();
100 $this->flashes = [];
101
102 return $return;
103 }
104
105 /**
106 * {@inheritdoc}
107 */
108 public function set($type, $messages)
109 {
110 $this->flashes[$type] = (array) $messages;
111 }
112
113 /**
114 * {@inheritdoc}
115 */
116 public function setAll(array $messages)
117 {
118 $this->flashes = $messages;
119 }
120
121 /**
122 * {@inheritdoc}
123 */
124 public function has($type)
125 {
126 return \array_key_exists($type, $this->flashes) && $this->flashes[$type];
127 }
128
129 /**
130 * {@inheritdoc}
131 */
132 public function keys()
133 {
134 return array_keys($this->flashes);
135 }
136
137 /**
138 * {@inheritdoc}
139 */
140 public function getStorageKey()
141 {
142 return $this->storageKey;
143 }
144
145 /**
146 * {@inheritdoc}
147 */
148 public function clear()
149 {
150 return $this->all();
151 }
152 }
153