1 | <?php |
||
22 | class Filesystem implements Handler |
||
23 | { |
||
24 | use HandlerTrait; |
||
25 | use FileHandlerTrait; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $savePath; |
||
31 | |||
32 | /** |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $filePrefix; |
||
36 | |||
37 | /** |
||
38 | * File session handler constructor. |
||
39 | * |
||
40 | * @param string $filePrefix |
||
41 | */ |
||
42 | public function __construct($filePrefix = 'sess_') |
||
46 | |||
47 | /** |
||
48 | * {@inheritdoc} |
||
49 | * |
||
50 | * @throws \RuntimeException |
||
51 | * |
||
52 | * @SuppressWarnings(PMD.UnusedFormalParameter) |
||
53 | */ |
||
54 | public function open($savePath, $sessionName) |
||
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | * |
||
66 | * @return bool |
||
67 | */ |
||
68 | public function close() |
||
72 | |||
73 | /** |
||
74 | * {@inheritdoc} |
||
75 | * |
||
76 | * @return bool |
||
77 | */ |
||
78 | public function destroy($sessionId) |
||
88 | |||
89 | /** |
||
90 | * {@inheritdoc} |
||
91 | */ |
||
92 | public function read($sessionId) |
||
114 | |||
115 | /** |
||
116 | * {@inheritdoc} |
||
117 | */ |
||
118 | public function write($sessionId, $sessionData) |
||
137 | |||
138 | /** |
||
139 | * {@inheritdoc} |
||
140 | * |
||
141 | * @SuppressWarnings(PMD.ShortMethodName) |
||
142 | * @SuppressWarnings(PMD.UnusedFormalParameter) |
||
143 | */ |
||
144 | public function gc($maxLifetime) |
||
159 | |||
160 | /** |
||
161 | * Get session file. |
||
162 | * |
||
163 | * @param string $sessionId |
||
164 | * |
||
165 | * @return string |
||
166 | */ |
||
167 | protected function getSessionFile(string $sessionId) : string |
||
171 | } |
||
172 |