class SessionHandlerProxy extends AbstractProxy implements SessionHandlerInterface
protected bool
|
$wrapper |
Flag if handler wraps an internal PHP session handler (using \SessionHandler). | from AbstractProxy |
protected string
|
$saveHandlerName |
from AbstractProxy | |
protected
|
$handler |
public
|
string |
getSaveHandlerName()
|
Gets the session.save_handler name. | from AbstractProxy |
public
|
bool |
isSessionHandlerInterface()
|
Is this proxy handler and instance of \SessionHandlerInterface. | from AbstractProxy |
public
|
bool |
isWrapper()
|
Returns true if this handler wraps an internal PHP session save handler using \SessionHandler. | from AbstractProxy |
public
|
bool |
isActive()
|
Has a session started? | from AbstractProxy |
public
|
string |
getId()
|
Gets the session ID. | from AbstractProxy |
public
|
|
setId(string $id)
|
Sets the session ID. | from AbstractProxy |
public
|
string |
getName()
|
Gets the session name. | from AbstractProxy |
public
|
|
setName(string $name)
|
Sets the session name. | from AbstractProxy |
public
|
|
__construct(SessionHandlerInterface $handler)
|
No description | |
public
|
SessionHandlerInterface |
getHandler()
|
No description | |
public
|
|
open($savePath, $sessionName)
|
{@inheritdoc} | |
public
|
|
close()
|
{@inheritdoc} | |
public
|
|
read($sessionId)
|
{@inheritdoc} | |
public
|
|
write($sessionId, $data)
|
{@inheritdoc} | |
public
|
|
destroy($sessionId)
|
{@inheritdoc} | |
public
|
|
gc($maxlifetime)
|
{@inheritdoc} |
getSaveHandlerName()public string getSaveHandlerName()
Gets the session.save_handler name.
string |
isSessionHandlerInterface()public bool isSessionHandlerInterface()
Is this proxy handler and instance of \SessionHandlerInterface.
bool |
isWrapper()public bool isWrapper()
Returns true if this handler wraps an internal PHP session save handler using \SessionHandler.
bool |
isActive()public bool isActive()
Has a session started?
bool |
getId()public string getId()
Gets the session ID.
string |
setId()public setId(string $id)
getName()public string getName()
Gets the session name.
string |
setName()public setName(string $name)
__construct()public __construct(SessionHandlerInterface $handler)
SessionHandlerInterface |
$handler |
getHandler()public SessionHandlerInterface getHandler()
SessionHandlerInterface |
open()public open($savePath, $sessionName)
{@inheritdoc}
$savePath |
||
$sessionName |
close()public close()
{@inheritdoc}
read()public read($sessionId)
{@inheritdoc}
$sessionId |
write()public write($sessionId, $data)
{@inheritdoc}
$sessionId |
||
$data |
destroy()public destroy($sessionId)
{@inheritdoc}
$sessionId |
gc()public gc($maxlifetime)
{@inheritdoc}
$maxlifetime |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpFoundation\Session\Storage\Proxy;
/**
* @author Drak <drak@zikula.org>
*/
class SessionHandlerProxy extends AbstractProxy implements \SessionHandlerInterface
{
protected $handler;
public function __construct(\SessionHandlerInterface $handler)
{
$this->handler = $handler;
$this->wrapper = ($handler instanceof \SessionHandler);
$this->saveHandlerName = $this->wrapper ? ini_get('session.save_handler') : 'user';
}
/**
* @return \SessionHandlerInterface
*/
public function getHandler()
{
return $this->handler;
}
// \SessionHandlerInterface
/**
* {@inheritdoc}
*/
public function open($savePath, $sessionName)
{
return (bool) $this->handler->open($savePath, $sessionName);
}
/**
* {@inheritdoc}
*/
public function close()
{
return (bool) $this->handler->close();
}
/**
* {@inheritdoc}
*/
public function read($sessionId)
{
return (string) $this->handler->read($sessionId);
}
/**
* {@inheritdoc}
*/
public function write($sessionId, $data)
{
return (bool) $this->handler->write($sessionId, $data);
}
/**
* {@inheritdoc}
*/
public function destroy($sessionId)
{
return (bool) $this->handler->destroy($sessionId);
}
/**
* {@inheritdoc}
*/
public function gc($maxlifetime)
{
return (bool) $this->handler->gc($maxlifetime);
}
}