Overview

Namespaces

  • Evenement
  • None
  • PHP
  • Psr
    • Http
      • Message
  • Ratchet
    • Http
    • RFC6455
      • Handshake
      • Messaging
    • Server
    • Session
      • Serialize
      • Storage
        • Proxy
    • Wamp
    • WebSocket
  • React
    • EventLoop
      • Tick
      • Timer
    • Socket
    • Stream
  • Symfony
    • Component
      • HttpFoundation
        • Session
          • Attribute
          • Flash
          • Storage
            • Handler
            • Proxy
      • Routing
        • Annotation
        • Exception
        • Generator
          • Dumper
        • Loader
          • DependencyInjection
        • Matcher
          • Dumper
        • Tests
          • Annotation
          • Fixtures
            • AnnotatedClasses
            • OtherAnnotatedClasses
          • Generator
            • Dumper
          • Loader
          • Matcher
            • Dumper

Classes

  • AbstractProxy
  • NativeProxy
  • SessionHandlerProxy
  • Overview
  • Namespace
  • Class
  • Tree
 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\Proxy;
13: 
14: /**
15:  * SessionHandler proxy.
16:  *
17:  * @author Drak <[email protected]>
18:  */
19: class SessionHandlerProxy extends AbstractProxy implements \SessionHandlerInterface
20: {
21:     /**
22:      * @var \SessionHandlerInterface
23:      */
24:     protected $handler;
25: 
26:     /**
27:      * Constructor.
28:      *
29:      * @param \SessionHandlerInterface $handler
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:     // \SessionHandlerInterface
39: 
40:     /**
41:      * {@inheritdoc}
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:      * {@inheritdoc}
56:      */
57:     public function close()
58:     {
59:         $this->active = false;
60: 
61:         return (bool) $this->handler->close();
62:     }
63: 
64:     /**
65:      * {@inheritdoc}
66:      */
67:     public function read($sessionId)
68:     {
69:         return (string) $this->handler->read($sessionId);
70:     }
71: 
72:     /**
73:      * {@inheritdoc}
74:      */
75:     public function write($sessionId, $data)
76:     {
77:         return (bool) $this->handler->write($sessionId, $data);
78:     }
79: 
80:     /**
81:      * {@inheritdoc}
82:      */
83:     public function destroy($sessionId)
84:     {
85:         return (bool) $this->handler->destroy($sessionId);
86:     }
87: 
88:     /**
89:      * {@inheritdoc}
90:      */
91:     public function gc($maxlifetime)
92:     {
93:         return (bool) $this->handler->gc($maxlifetime);
94:     }
95: }
96: 
Ratchet API documentation generated by ApiGen 2.8.0