class SessionHandlerProxy in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php \Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy
SessionHandler proxy.
@author Drak <drak@zikula.org>
Hierarchy
- class \Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy
- class \Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy implements \Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerInterface
Expanded class hierarchy of SessionHandlerProxy
3 files declare their use of SessionHandlerProxy
- NativeSessionStorage.php in vendor/
symfony/ http-foundation/ Session/ Storage/ NativeSessionStorage.php - NativeSessionStorageTest.php in vendor/
symfony/ http-foundation/ Tests/ Session/ Storage/ NativeSessionStorageTest.php - SessionHandlerProxyTest.php in vendor/
symfony/ http-foundation/ Tests/ Session/ Storage/ Proxy/ SessionHandlerProxyTest.php
File
- vendor/
symfony/ http-foundation/ Session/ Storage/ Proxy/ SessionHandlerProxy.php, line 19
Namespace
Symfony\Component\HttpFoundation\Session\Storage\ProxyView source
class SessionHandlerProxy extends AbstractProxy implements \SessionHandlerInterface {
/**
* @var \SessionHandlerInterface
*/
protected $handler;
/**
* Constructor.
*
* @param \SessionHandlerInterface $handler
*/
public function __construct(\SessionHandlerInterface $handler) {
$this->handler = $handler;
$this->wrapper = $handler instanceof \SessionHandler;
$this->saveHandlerName = $this->wrapper ? ini_get('session.save_handler') : 'user';
}
// \SessionHandlerInterface
/**
* {@inheritdoc}
*/
public function open($savePath, $sessionName) {
$return = (bool) $this->handler
->open($savePath, $sessionName);
if (true === $return) {
$this->active = true;
}
return $return;
}
/**
* {@inheritdoc}
*/
public function close() {
$this->active = false;
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);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AbstractProxy:: |
protected | property | ||
AbstractProxy:: |
protected | property | ||
AbstractProxy:: |
protected | property | Flag if handler wraps an internal PHP session handler (using \SessionHandler). | |
AbstractProxy:: |
public | function | Gets the session ID. | |
AbstractProxy:: |
public | function | Gets the session name. | |
AbstractProxy:: |
public | function | Gets the session.save_handler name. | |
AbstractProxy:: |
public | function | Has a session started? | |
AbstractProxy:: |
public | function | Is this proxy handler and instance of \SessionHandlerInterface. | |
AbstractProxy:: |
public | function | Returns true if this handler wraps an internal PHP session save handler using \SessionHandler. | 1 |
AbstractProxy:: |
public | function | Sets the active flag. | |
AbstractProxy:: |
public | function | Sets the session ID. | |
AbstractProxy:: |
public | function | Sets the session name. | |
SessionHandlerProxy:: |
protected | property | ||
SessionHandlerProxy:: |
public | function | ||
SessionHandlerProxy:: |
public | function | ||
SessionHandlerProxy:: |
public | function | ||
SessionHandlerProxy:: |
public | function | ||
SessionHandlerProxy:: |
public | function | ||
SessionHandlerProxy:: |
public | function | ||
SessionHandlerProxy:: |
public | function | Constructor. |