4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\HttpFoundation\Session\Storage\Proxy;
15 * SessionHandler proxy.
17 * @author Drak <drak@zikula.org>
19 class SessionHandlerProxy extends AbstractProxy implements \SessionHandlerInterface
22 * @var \SessionHandlerInterface
29 * @param \SessionHandlerInterface $handler
31 public function __construct(\SessionHandlerInterface $handler)
33 $this->handler = $handler;
34 $this->wrapper = ($handler instanceof \SessionHandler);
35 $this->saveHandlerName = $this->wrapper ? ini_get('session.save_handler') : 'user';
38 // \SessionHandlerInterface
43 public function open($savePath, $sessionName)
45 return (bool) $this->handler->open($savePath, $sessionName);
51 public function close()
53 return (bool) $this->handler->close();
59 public function read($sessionId)
61 return (string) $this->handler->read($sessionId);
67 public function write($sessionId, $data)
69 return (bool) $this->handler->write($sessionId, $data);
75 public function destroy($sessionId)
77 return (bool) $this->handler->destroy($sessionId);
83 public function gc($maxlifetime)
85 return (bool) $this->handler->gc($maxlifetime);