upgraded dependencies
This commit is contained in:
@@ -54,7 +54,7 @@ class RedisSessionHandler extends AbstractSessionHandler
|
||||
!$redis instanceof RedisProxy &&
|
||||
!$redis instanceof RedisClusterProxy
|
||||
) {
|
||||
throw new \InvalidArgumentException(sprintf('"%s()" expects parameter 1 to be Redis, RedisArray, RedisCluster or Predis\ClientInterface, "%s" given.', __METHOD__, \is_object($redis) ? \get_class($redis) : \gettype($redis)));
|
||||
throw new \InvalidArgumentException(sprintf('"%s()" expects parameter 1 to be Redis, RedisArray, RedisCluster or Predis\ClientInterface, "%s" given.', __METHOD__, get_debug_type($redis)));
|
||||
}
|
||||
|
||||
if ($diff = array_diff(array_keys($options), ['prefix', 'ttl'])) {
|
||||
@@ -69,7 +69,7 @@ class RedisSessionHandler extends AbstractSessionHandler
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function doRead($sessionId): string
|
||||
protected function doRead(string $sessionId): string
|
||||
{
|
||||
return $this->redis->get($this->prefix.$sessionId) ?: '';
|
||||
}
|
||||
@@ -77,7 +77,7 @@ class RedisSessionHandler extends AbstractSessionHandler
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function doWrite($sessionId, $data): bool
|
||||
protected function doWrite(string $sessionId, string $data): bool
|
||||
{
|
||||
$result = $this->redis->setEx($this->prefix.$sessionId, (int) ($this->ttl ?? \ini_get('session.gc_maxlifetime')), $data);
|
||||
|
||||
@@ -87,9 +87,21 @@ class RedisSessionHandler extends AbstractSessionHandler
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function doDestroy($sessionId): bool
|
||||
protected function doDestroy(string $sessionId): bool
|
||||
{
|
||||
$this->redis->del($this->prefix.$sessionId);
|
||||
static $unlink = true;
|
||||
|
||||
if ($unlink) {
|
||||
try {
|
||||
$unlink = false !== $this->redis->unlink($this->prefix.$sessionId);
|
||||
} catch (\Throwable $e) {
|
||||
$unlink = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$unlink) {
|
||||
$this->redis->del($this->prefix.$sessionId);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user