PluginProbe
WPIDE – File Manager & Code Editor / 3.5.10
WPIDE – File Manager & Code Editor v3.5.10
3.5.10 3.5.9 3.5.8 3.5.7 2.0.14 2.0.15 2.0.16 2.0.2 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1 2.2 2.3 2.3.1 2.3.2 2.4.0 2.5 2.6 3.0 3.1 3.2 All 56 releases
wpide / vendor / symfony / http-foundation / Session / Storage / Handler / MarshallingSessionHandler.php

MarshallingSessionHandler.php in WPIDE – File Manager & Code Editor 3.5.10, at vendor/symfony/http-foundation/Session/Storage/Handler/MarshallingSessionHandler.php

109 lines 2.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <[email protected]>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12 namespace Symfony\Component\HttpFoundation\Session\Storage\Handler;
13
14 use Symfony\Component\Cache\Marshaller\MarshallerInterface;
15
16 /**
17 * @author Ahmed TAILOULOUTE <[email protected]>
18 */
19 class MarshallingSessionHandler implements \SessionHandlerInterface, \SessionUpdateTimestampHandlerInterface
20 {
21 private $handler;
22 private $marshaller;
23
24 public function __construct(AbstractSessionHandler $handler, MarshallerInterface $marshaller)
25 {
26 $this->handler = $handler;
27 $this->marshaller = $marshaller;
28 }
29
30 /**
31 * @return bool
32 */
33 #[\ReturnTypeWillChange]
34 public function open($savePath, $name)
35 {
36 return $this->handler->open($savePath, $name);
37 }
38
39 /**
40 * @return bool
41 */
42 #[\ReturnTypeWillChange]
43 public function close()
44 {
45 return $this->handler->close();
46 }
47
48 /**
49 * @return bool
50 */
51 #[\ReturnTypeWillChange]
52 public function destroy($sessionId)
53 {
54 return $this->handler->destroy($sessionId);
55 }
56
57 /**
58 * @return int|false
59 */
60 #[\ReturnTypeWillChange]
61 public function gc($maxlifetime)
62 {
63 return $this->handler->gc($maxlifetime);
64 }
65
66 /**
67 * @return string
68 */
69 #[\ReturnTypeWillChange]
70 public function read($sessionId)
71 {
72 return $this->marshaller->unmarshall($this->handler->read($sessionId));
73 }
74
75 /**
76 * @return bool
77 */
78 #[\ReturnTypeWillChange]
79 public function write($sessionId, $data)
80 {
81 $failed = [];
82 $marshalledData = $this->marshaller->marshall(['data' => $data], $failed);
83
84 if (isset($failed['data'])) {
85 return false;
86 }
87
88 return $this->handler->write($sessionId, $marshalledData['data']);
89 }
90
91 /**
92 * @return bool
93 */
94 #[\ReturnTypeWillChange]
95 public function validateId($sessionId)
96 {
97 return $this->handler->validateId($sessionId);
98 }
99
100 /**
101 * @return bool
102 */
103 #[\ReturnTypeWillChange]
104 public function updateTimestamp($sessionId, $data)
105 {
106 return $this->handler->updateTimestamp($sessionId, $data);
107 }
108 }
109