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 |
StrictSessionHandler.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\Handler;
013
014 /**
015 * Adds basic `SessionUpdateTimestampHandlerInterface` behaviors to another `SessionHandlerInterface`.
016 *
017 * @author Nicolas Grekas <p@tchwork.com>
018 */
019 class StrictSessionHandler extends AbstractSessionHandler
020 {
021 private $handler;
022 private $doDestroy;
023
024 public function __construct(\SessionHandlerInterface $handler)
025 {
026 if ($handler instanceof \SessionUpdateTimestampHandlerInterface) {
027 throw new \LogicException(sprintf('"%s" is already an instance of "SessionUpdateTimestampHandlerInterface", you cannot wrap it with "%s".', \get_class($handler), self::class));
028 }
029
030 $this->handler = $handler;
031 }
032
033 /**
034 * {@inheritdoc}
035 */
036 public function open($savePath, $sessionName)
037 {
038 parent::open($savePath, $sessionName);
039
040 return $this->handler->open($savePath, $sessionName);
041 }
042
043 /**
044 * {@inheritdoc}
045 */
046 protected function doRead($sessionId)
047 {
048 return $this->handler->read($sessionId);
049 }
050
051 /**
052 * {@inheritdoc}
053 */
054 public function updateTimestamp($sessionId, $data)
055 {
056 return $this->write($sessionId, $data);
057 }
058
059 /**
060 * {@inheritdoc}
061 */
062 protected function doWrite($sessionId, $data)
063 {
064 return $this->handler->write($sessionId, $data);
065 }
066
067 /**
068 * {@inheritdoc}
069 */
070 public function destroy($sessionId)
071 {
072 $this->doDestroy = true;
073 $destroyed = parent::destroy($sessionId);
074
075 return $this->doDestroy ? $this->doDestroy($sessionId) : $destroyed;
076 }
077
078 /**
079 * {@inheritdoc}
080 */
081 protected function doDestroy($sessionId)
082 {
083 $this->doDestroy = false;
084
085 return $this->handler->destroy($sessionId);
086 }
087
088 /**
089 * {@inheritdoc}
090 */
091 public function close()
092 {
093 return $this->handler->close();
094 }
095
096 /**
097 * @return bool
098 */
099 public function gc($maxlifetime)
100 {
101 return $this->handler->gc($maxlifetime);
102 }
103 }
104