class SessionHandlerProxy
@author Drak <drak@zikula.org>
Hierarchy
- class \Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy
- class \Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy extends \Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy implements \Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerInterface, \Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionUpdateTimestampHandlerInterface
Expanded class hierarchy of SessionHandlerProxy
1 file declares its use of SessionHandlerProxy
- NativeSessionStorage.php in vendor/
symfony/ http-foundation/ Session/ Storage/ NativeSessionStorage.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, \SessionUpdateTimestampHandlerInterface {
public function __construct(\SessionHandlerInterface $handler) {
$this->wrapper = $handler instanceof \SessionHandler;
$this->saveHandlerName = $this->wrapper || $handler instanceof StrictSessionHandler && $handler->isWrapper() ? \ini_get('session.save_handler') : 'user';
}
public function getHandler() : \SessionHandlerInterface {
return $this->handler;
}
// \SessionHandlerInterface
public function open(string $savePath, string $sessionName) : bool {
return $this->handler
->open($savePath, $sessionName);
}
public function close() : bool {
return $this->handler
->close();
}
public function read(string $sessionId) : string|false {
return $this->handler
->read($sessionId);
}
public function write(string $sessionId, string $data) : bool {
return $this->handler
->write($sessionId, $data);
}
public function destroy(string $sessionId) : bool {
return $this->handler
->destroy($sessionId);
}
public function gc(int $maxlifetime) : int|false {
return $this->handler
->gc($maxlifetime);
}
public function validateId(string $sessionId) : bool {
return !$this->handler instanceof \SessionUpdateTimestampHandlerInterface || $this->handler
->validateId($sessionId);
}
public function updateTimestamp(string $sessionId, string $data) : bool {
return $this->handler instanceof \SessionUpdateTimestampHandlerInterface ? $this->handler
->updateTimestamp($sessionId, $data) : $this->write($sessionId, $data);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
AbstractProxy::$saveHandlerName | protected | property | |
AbstractProxy::$wrapper | protected | property | |
AbstractProxy::getId | public | function | Gets the session ID. |
AbstractProxy::getName | public | function | Gets the session name. |
AbstractProxy::getSaveHandlerName | public | function | Gets the session.save_handler name. |
AbstractProxy::isActive | public | function | Has a session started? |
AbstractProxy::isSessionHandlerInterface | public | function | Is this proxy handler and instance of \SessionHandlerInterface. |
AbstractProxy::isWrapper | public | function | Returns true if this handler wraps an internal PHP session save handler using \SessionHandler. |
AbstractProxy::setId | public | function | Sets the session ID. |
AbstractProxy::setName | public | function | Sets the session name. |
SessionHandlerProxy::close | public | function | |
SessionHandlerProxy::destroy | public | function | |
SessionHandlerProxy::gc | public | function | |
SessionHandlerProxy::getHandler | public | function | |
SessionHandlerProxy::open | public | function | |
SessionHandlerProxy::read | public | function | |
SessionHandlerProxy::updateTimestamp | public | function | |
SessionHandlerProxy::validateId | public | function | |
SessionHandlerProxy::write | public | function | |
SessionHandlerProxy::__construct | public | function |