1: <?php
2:
3: 4: 5: 6: 7: 8: 9: 10:
11:
12: namespace Symfony\Component\HttpFoundation\Session\Storage\Proxy;
13:
14: 15: 16: 17: 18:
19: class SessionHandlerProxy extends AbstractProxy implements \SessionHandlerInterface
20: {
21: 22: 23:
24: protected $handler;
25:
26: 27: 28: 29: 30:
31: public function __construct(\SessionHandlerInterface $handler)
32: {
33: $this->handler = $handler;
34: $this->wrapper = ($handler instanceof \SessionHandler);
35: $this->saveHandlerName = $this->wrapper ? ini_get('session.save_handler') : 'user';
36: }
37:
38:
39:
40: 41: 42:
43: public function open($savePath, $sessionName)
44: {
45: $return = (bool) $this->handler->open($savePath, $sessionName);
46:
47: if (true === $return) {
48: $this->active = true;
49: }
50:
51: return $return;
52: }
53:
54: 55: 56:
57: public function close()
58: {
59: $this->active = false;
60:
61: return (bool) $this->handler->close();
62: }
63:
64: 65: 66:
67: public function read($sessionId)
68: {
69: return (string) $this->handler->read($sessionId);
70: }
71:
72: 73: 74:
75: public function write($sessionId, $data)
76: {
77: return (bool) $this->handler->write($sessionId, $data);
78: }
79:
80: 81: 82:
83: public function destroy($sessionId)
84: {
85: return (bool) $this->handler->destroy($sessionId);
86: }
87:
88: 89: 90:
91: public function gc($maxlifetime)
92: {
93: return (bool) $this->handler->gc($maxlifetime);
94: }
95: }
96: