-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIlluminateSessionHandler.php
More file actions
95 lines (82 loc) · 1.85 KB
/
Copy pathIlluminateSessionHandler.php
File metadata and controls
95 lines (82 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php
namespace Detain\SessionSamurai;
use Illuminate\Session\DatabaseSessionHandler;
use Illuminate\Session\SessionManager;
use Illuminate\Support\Arr;
class IlluminateSessionHandler implements \SessionHandlerInterface, \SessionIdInterface, \SessionUpdateTimestampHandlerInterface
{
protected $manager;
protected $handler;
public function __construct(SessionManager $manager)
{
$this->manager = $manager;
$this->handler = $this->manager->driver()->getHandler();
}
/**
* {@inheritdoc}
*/
public function open($savePath, $sessionName): bool
{
return true;
}
/**
* {@inheritdoc}
*/
public function close(): bool
{
return true;
}
/**
* {@inheritdoc}
*/
public function read($sessionId)
{
return $this->handler->read($sessionId);
}
/**
* {@inheritdoc}
*/
public function write($sessionId, $data): bool
{
$this->handler->write($sessionId, $data);
return true;
}
/**
* {@inheritdoc}
*/
public function destroy($sessionId): bool
{
$this->handler->destroy($sessionId);
return true;
}
/**
* {@inheritdoc}
*/
public function gc($maxLifetime)
{
$this->handler->gc($maxLifetime);
return true;
}
/**
* {@inheritdoc}
*/
// phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps
public function create_sid()
{
return $this->manager->driver()->generateSessionId();
}
/**
* {@inheritdoc}
*/
public function validateId($sessionId)
{
return $this->handler->validateId($sessionId);
}
/**
* {@inheritdoc}
*/
public function updateTimestamp($sessionId, $data)
{
return $this->handler->updateTimestamp($sessionId, $data);
}
}