1 | <?php |
||
6 | class GlobalHandler implements SessionHandlerInterface |
||
7 | { |
||
8 | /** |
||
9 | * {@inheritdoc} |
||
10 | */ |
||
11 | 2 | public function destroy($sessionId) |
|
18 | |||
19 | /** |
||
20 | * {@inheritdoc} |
||
21 | */ |
||
22 | 3 | public function read($sessionId) |
|
30 | |||
31 | /** |
||
32 | * {@inheritdoc} |
||
33 | */ |
||
34 | 2 | public function write($sessionId, $sessionData) |
|
42 | |||
43 | /** |
||
44 | * {@inheritdoc} |
||
45 | */ |
||
46 | public function close() |
||
50 | |||
51 | /** |
||
52 | * {@inheritdoc} |
||
53 | */ |
||
54 | 1 | public function gc($maxLifeTime) |
|
55 | { |
||
56 | 1 | return true; |
|
57 | } |
||
58 | |||
59 | /** |
||
60 | * {@inheritdoc} |
||
61 | */ |
||
62 | public function open($savePath, $sessionId) |
||
66 | |||
67 | 4 | protected function bootSession() |
|
75 | } |
||
76 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: