Skip to content

Commit 2e0c35e

Browse files
Merge branch '3.4'
* 3.4: (21 commits) fixed CS HttpCache lock update [Intl] Update ICU data to 60.1 [YAML] Allow to parse custom tags when linting yaml files [HttpKernel][Debug] Remove noise from stack frames of deprecations [WebServerBundle] prevent console.terminate from being fired after stopping server [Validator] Fix Costa Rica IBAN format [Bridge/ProxyManager] Remove direct reference to value holder property [Validator] Add Belarus IBAN format [Config] Fix cannotBeEmpty() [Debug] More aggressively aggregate silenced notices per file+line [HttpFoundation] minor session-related fix [Cache][Lock] Add RedisProxy for lazy Redis connections [TwigBridge] [Bootstrap 4] Fix validation error design for expanded choiceType [FrameworkBundle] Specifically inject the debug dispatcher in the collector [WebserverBundle] fixed the bug that caused that the webserver would … update the pull request template [Stopwatch] minor fix Add default mapping path for validator component Add default mapping path for serializer component ...
2 parents 689635e + 9eadede commit 2e0c35e

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

Store/RedisStore.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Lock\Store;
1313

14+
use Symfony\Component\Cache\Traits\RedisProxy;
1415
use Symfony\Component\Lock\Exception\InvalidArgumentException;
1516
use Symfony\Component\Lock\Exception\LockConflictedException;
1617
use Symfony\Component\Lock\Exception\LockExpiredException;
@@ -24,14 +25,6 @@
2425
*/
2526
class RedisStore implements StoreInterface
2627
{
27-
private static $defaultConnectionOptions = array(
28-
'class' => null,
29-
'persistent' => 0,
30-
'persistent_id' => null,
31-
'timeout' => 30,
32-
'read_timeout' => 0,
33-
'retry_interval' => 0,
34-
);
3528
private $redis;
3629
private $initialTtl;
3730

@@ -41,7 +34,7 @@ class RedisStore implements StoreInterface
4134
*/
4235
public function __construct($redisClient, float $initialTtl = 300.0)
4336
{
44-
if (!$redisClient instanceof \Redis && !$redisClient instanceof \RedisArray && !$redisClient instanceof \RedisCluster && !$redisClient instanceof \Predis\Client) {
37+
if (!$redisClient instanceof \Redis && !$redisClient instanceof \RedisArray && !$redisClient instanceof \RedisCluster && !$redisClient instanceof \Predis\Client && !$redisClient instanceof RedisProxy) {
4538
throw new InvalidArgumentException(sprintf('%s() expects parameter 1 to be Redis, RedisArray, RedisCluster or Predis\Client, %s given', __METHOD__, is_object($redisClient) ? get_class($redisClient) : gettype($redisClient)));
4639
}
4740

@@ -135,7 +128,7 @@ public function exists(Key $key)
135128
*/
136129
private function evaluate(string $script, string $resource, array $args)
137130
{
138-
if ($this->redis instanceof \Redis || $this->redis instanceof \RedisCluster) {
131+
if ($this->redis instanceof \Redis || $this->redis instanceof \RedisCluster || $this->redis instanceof RedisProxy) {
139132
return $this->redis->eval($script, array_merge(array($resource), $args), 1);
140133
}
141134

Store/StoreFactory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Lock\Store;
1313

14+
use Symfony\Component\Cache\Traits\RedisProxy;
1415
use Symfony\Component\Lock\Exception\InvalidArgumentException;
1516

1617
/**
@@ -27,7 +28,7 @@ class StoreFactory
2728
*/
2829
public static function createStore($connection)
2930
{
30-
if ($connection instanceof \Redis || $connection instanceof \RedisArray || $connection instanceof \RedisCluster || $connection instanceof \Predis\Client) {
31+
if ($connection instanceof \Redis || $connection instanceof \RedisArray || $connection instanceof \RedisCluster || $connection instanceof \Predis\Client || $connection instanceof RedisProxy) {
3132
return new RedisStore($connection);
3233
}
3334
if ($connection instanceof \Memcached) {

0 commit comments

Comments
 (0)