function MemcachedSessionHandler::__construct
Constructor.
List of available options:
- prefix: The prefix to use for the memcached keys in order to avoid collision
- ttl: The time to live in seconds.
Throws
\InvalidArgumentException When unsupported options are passed
File
-
vendor/
symfony/ http-foundation/ Session/ Storage/ Handler/ MemcachedSessionHandler.php, line 43
Class
- MemcachedSessionHandler
- Memcached based session storage handler based on the Memcached class provided by the PHP memcached extension.
Namespace
Symfony\Component\HttpFoundation\Session\Storage\HandlerCode
public function __construct(\Memcached $memcached, array $options = []) {
if ($diff = array_diff(array_keys($options), [
'prefix',
'expiretime',
'ttl',
])) {
throw new \InvalidArgumentException(\sprintf('The following options are not supported "%s".', implode(', ', $diff)));
}
$this->ttl = $options['expiretime'] ?? $options['ttl'] ?? null;
$this->prefix = $options['prefix'] ?? 'sf2s';
}