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 |
SessionStorageInterface.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\Storage;
013
014 use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
015
016 /**
017 * StorageInterface.
018 *
019 * @author Fabien Potencier <fabien@symfony.com>
020 * @author Drak <drak@zikula.org>
021 */
022 interface SessionStorageInterface
023 {
024 /**
025 * Starts the session.
026 *
027 * @return bool True if started
028 *
029 * @throws \RuntimeException if something goes wrong starting the session
030 */
031 public function start();
032
033 /**
034 * Checks if the session is started.
035 *
036 * @return bool True if started, false otherwise
037 */
038 public function isStarted();
039
040 /**
041 * Returns the session ID.
042 *
043 * @return string The session ID or empty
044 */
045 public function getId();
046
047 /**
048 * Sets the session ID.
049 *
050 * @param string $id
051 */
052 public function setId($id);
053
054 /**
055 * Returns the session name.
056 *
057 * @return mixed The session name
058 */
059 public function getName();
060
061 /**
062 * Sets the session name.
063 *
064 * @param string $name
065 */
066 public function setName($name);
067
068 /**
069 * Regenerates id that represents this storage.
070 *
071 * This method must invoke session_regenerate_id($destroy) unless
072 * this interface is used for a storage object designed for unit
073 * or functional testing where a real PHP session would interfere
074 * with testing.
075 *
076 * Note regenerate+destroy should not clear the session data in memory
077 * only delete the session data from persistent storage.
078 *
079 * Care: When regenerating the session ID no locking is involved in PHP's
080 * session design. See https://bugs.php.net/61470 for a discussion.
081 * So you must make sure the regenerated session is saved BEFORE sending the
082 * headers with the new ID. Symfony's HttpKernel offers a listener for this.
083 * See Symfony\Component\HttpKernel\EventListener\SaveSessionListener.
084 * Otherwise session data could get lost again for concurrent requests with the
085 * new ID. One result could be that you get logged out after just logging in.
086 *
087 * @param bool $destroy Destroy session when regenerating?
088 * @param int $lifetime Sets the cookie lifetime for the session cookie. A null value
089 * will leave the system settings unchanged, 0 sets the cookie
090 * to expire with browser session. Time is in seconds, and is
091 * not a Unix timestamp.
092 *
093 * @return bool True if session regenerated, false if error
094 *
095 * @throws \RuntimeException If an error occurs while regenerating this storage
096 */
097 public function regenerate($destroy = false, $lifetime = null);
098
099 /**
100 * Force the session to be saved and closed.
101 *
102 * This method must invoke session_write_close() unless this interface is
103 * used for a storage object design for unit or functional testing where
104 * a real PHP session would interfere with testing, in which case
105 * it should actually persist the session data if required.
106 *
107 * @throws \RuntimeException if the session is saved without being started, or if the session
108 * is already closed
109 */
110 public function save();
111
112 /**
113 * Clear all session data in memory.
114 */
115 public function clear();
116
117 /**
118 * Gets a SessionBagInterface by name.
119 *
120 * @param string $name
121 *
122 * @return SessionBagInterface
123 *
124 * @throws \InvalidArgumentException If the bag does not exist
125 */
126 public function getBag($name);
127
128 /**
129 * Registers a SessionBagInterface for use.
130 */
131 public function registerBag(SessionBagInterface $bag);
132
133 /**
134 * @return MetadataBag
135 */
136 public function getMetadataBag();
137 }
138