* * 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\Handler; @trigger_error(sprintf('The class %s is deprecated since Symfony 3.4 and will be removed in 4.0. Use Symfony\Component\HttpFoundation\Session\Storage\Handler\MemcachedSessionHandler instead.', MemcacheSessionHandler::class), E_USER_DEPRECATED); /** * @author Drak * * @deprecated since version 3.4, to be removed in 4.0. Use Symfony\Component\HttpFoundation\Session\Storage\Handler\MemcachedSessionHandler instead. */ class MemcacheSessionHandler implements \SessionHandlerInterface { private $memcache; /** * @var int Time to live in seconds */ private $ttl; /** * @var string Key prefix for shared environments */ private $prefix; /** * Constructor. * * List of available options: * * prefix: The prefix to use for the memcache keys in order to avoid collision * * expiretime: The time to live in seconds * * @param \Memcache $memcache A \Memcache instance * @param array $options An associative array of Memcache options * * @throws \InvalidArgumentException When unsupported options are passed */ public function __construct(\Memcache $memcache, array $options = array()) { if ($diff = array_diff(array_keys($options), array('prefix', 'expiretime'))) { throw new \InvalidArgumentException(sprintf( 'The following options are not supported "%s"', implode(', ', $diff) )); } $this->memcache = $memcache; $this->ttl = isset($options['expiretime']) ? (int) $options['expiretime'] : 86400; $this->prefix = isset($options['prefix']) ? $options['prefix'] : 'sf2s'; } /** * {@inheritdoc} */ public function open($savePath, $sessionName) { return true; } /** * {@inheritdoc} */ public function close() { return true; } /** * {@inheritdoc} */ public function read($sessionId) { return $this->memcache->get($this->prefix.$sessionId) ?: ''; } /** * {@inheritdoc} */ public function write($sessionId, $data) { return $this->memcache->set($this->prefix.$sessionId, $data, 0, time() + $this->ttl); } /** * {@inheritdoc} */ public function destroy($sessionId) { $this->memcache->delete($this->prefix.$sessionId); return true; } /** * {@inheritdoc} */ public function gc($maxlifetime) { // not required here because memcache will auto expire the records anyhow. return true; } /** * Return a Memcache instance. * * @return \Memcache */ protected function getMemcache() { return $this->memcache; } } __halt_compiler();----SIGNATURE:----lyYLrQXGhlkPxGxBzWNbW7WMIl7ydF69cinMksmC9t2oP+0oyEx3SaFXy+QoDauC32FjPtWVW6sY6jz7UOCNans3etDLP/SOAl5Ra+adSOvg3zIchphHWry0q5U9YQ8fKtvakvXEaFOYkoAqSb5RMsDVQK+SIy31MTZZ4dnDyvZtxSUx5FwNwrkb/1iCYMKhkJwdi4B7QaLFS0txhOOy5+V7bbb5OjZxRee9/CtLVeOWkfWoR+jhcbwOore9GLx2VjOstg3EKk3WE9SBobLyvO8IHrPFy6HZ4IwBN+VsQVBDZxF3l6vbY0IYbUeApjp95rtiVAWF5CzpDbZTcbeFPop6FFIxi80pf9s/iyE67UV4Gw1MadKl9kgfqBuqNPj3aNpferKS+jzQMJKysP5liSKRgEXFJAMAHRPMEiNhp6KMbqlJmPHdF/UgUGrujWNsbzyV2tEL58UXJKWj4RbpRK2jO3J8s3EKPrsYD9xZK8l+BqbNeNkyEqyKG3EbBI4BZQ3porxG0cT/GZWq9Gi+Avilwg2xu3SweFb+qX+BK5F0mh1KTGBQntXPFJ1vMPcFPn3p6klBxcaM1J//J0VcfOXZ6Gmn9dH2BH7TVH6AxjPQoRqbYlPrqw9wZ/Tmo8cRlbfoiWZ15An8oTiRbrxZGEfmKrhZHtl5dZxPT9mui7M=----ATTACHMENT:----OTE3ODY5NjU4MzAyODk2MCA5NDE0OTMxNjUzNzM2Mzg4IDE1NTQ2NDEwOTIyNTI0NA==