Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Symfony/Component/Cache/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CHANGELOG
7.4
---

* Bump ext-redis to 6.2 and ext-relay to 0.11 minimum
* Bump ext-redis to 6.2 and ext-relay to 0.12 minimum

7.3
---
Expand Down
6 changes: 1 addition & 5 deletions src/Symfony/Component/Cache/Traits/RedisTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public static function createConnection(#[\SensitiveParameter] string $dsn, arra
}

try {
if (version_compare(phpversion('redis'), '6.0.0', '>=') && $isRedisExt) {
if ($isRedisExt) {
$options = [
'host' => $host,
'port' => $port,
Expand Down Expand Up @@ -351,10 +351,6 @@ public static function createConnection(#[\SensitiveParameter] string $dsn, arra
$redis->setOption($isRedisExt ? \Redis::OPT_TCP_KEEPALIVE : Relay::OPT_TCP_KEEPALIVE, $params['tcp_keepalive']);
}
} elseif (is_a($class, RelayCluster::class, true)) {
if (version_compare(phpversion('relay'), '0.10.0', '<')) {
throw new InvalidArgumentException('Using RelayCluster is supported from ext-relay 0.10.0 or higher.');
}

$initializer = static function () use ($class, $params, $hosts) {
foreach ($hosts as $i => $host) {
$hosts[$i] = match ($host['scheme']) {
Expand Down
107 changes: 0 additions & 107 deletions src/Symfony/Component/Cache/Traits/Relay/Relay12Trait.php

This file was deleted.

5 changes: 0 additions & 5 deletions src/Symfony/Component/Cache/Traits/Relay/WaitaofTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
*/
trait WaitaofTrait
{

public function waitaof(array|string $key_or_address, int $numlocal, int $numremote, int $timeout): Cluster|array|false
{
return $this->initializeLazyObject()->waitaof(...\func_get_args());
}
}
} else {
/**
Expand Down
7 changes: 5 additions & 2 deletions src/Symfony/Component/Cache/Traits/RelayClusterProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace Symfony\Component\Cache\Traits;

use Symfony\Component\Cache\Traits\Relay\WaitaofTrait;
use Symfony\Component\VarExporter\LazyObjectInterface;
use Symfony\Contracts\Service\ResetInterface;

Expand All @@ -28,7 +27,6 @@ class RelayClusterProxy extends \Relay\Cluster implements ResetInterface, LazyOb
use RedisProxyTrait {
resetLazyObject as reset;
}
use WaitaofTrait;

public function __construct($name, $seeds = null, $connect_timeout = 0, $command_timeout = 0, $persistent = false, #[\SensitiveParameter] $auth = null, $context = null)
{
Expand Down Expand Up @@ -1015,6 +1013,11 @@ public function watch($key, ...$other_keys): \Relay\Cluster|bool
return $this->initializeLazyObject()->watch(...\func_get_args());
}

public function waitaof(array|string $key_or_address, int $numlocal, int $numremote, int $timeout): \Relay\Cluster|array|false
{
return $this->initializeLazyObject()->waitaof(...\func_get_args());
}

public function xack($key, $group, $ids): \Relay\Cluster|false|int
{
return $this->initializeLazyObject()->xack(...\func_get_args());
Expand Down
82 changes: 80 additions & 2 deletions src/Symfony/Component/Cache/Traits/RelayProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace Symfony\Component\Cache\Traits;

use Symfony\Component\Cache\Traits\Relay\Relay12Trait;
use Symfony\Component\VarExporter\LazyObjectInterface;
use Symfony\Contracts\Service\ResetInterface;

Expand All @@ -28,7 +27,6 @@ class RelayProxy extends \Relay\Relay implements ResetInterface, LazyObjectInter
use RedisProxyTrait {
resetLazyObject as reset;
}
use Relay12Trait;

public function __construct($host = null, $port = 6379, $connect_timeout = 0.0, $command_timeout = 0.0, #[\SensitiveParameter] $context = [], $database = 0)
{
Expand Down Expand Up @@ -270,6 +268,11 @@ public function del(...$keys): \Relay\Relay|bool|int
return $this->initializeLazyObject()->del(...\func_get_args());
}

public function delifeq($key, $value): \Relay\Relay|false|int
{
return $this->initializeLazyObject()->delifeq(...\func_get_args());
}

public function discard(): bool
{
return $this->initializeLazyObject()->discard(...\func_get_args());
Expand Down Expand Up @@ -1420,6 +1423,71 @@ public function unwatch(): \Relay\Relay|bool
return $this->initializeLazyObject()->unwatch(...\func_get_args());
}

public function vadd($key, $values, $element, $options = null): \Relay\Relay|false|int
{
return $this->initializeLazyObject()->vadd(...\func_get_args());
}

public function vcard($key): \Relay\Relay|false|int
{
return $this->initializeLazyObject()->vcard(...\func_get_args());
}

public function vdim($key): \Relay\Relay|false|int
{
return $this->initializeLazyObject()->vdim(...\func_get_args());
}

public function vemb($key, $element, $raw = false): \Relay\Relay|array|false
{
return $this->initializeLazyObject()->vemb(...\func_get_args());
}

public function vgetattr($key, $element, $raw = false): \Relay\Relay|array|false|string
{
return $this->initializeLazyObject()->vgetattr(...\func_get_args());
}

public function vinfo($key): \Relay\Relay|array|false
{
return $this->initializeLazyObject()->vinfo(...\func_get_args());
}

public function vismember($key, $element): \Relay\Relay|bool
{
return $this->initializeLazyObject()->vismember(...\func_get_args());
}

public function vlinks($key, $element, $withscores): \Relay\Relay|array|false
{
return $this->initializeLazyObject()->vlinks(...\func_get_args());
}

public function vrandmember($key, $count = 0): \Relay\Relay|array|false|string
{
return $this->initializeLazyObject()->vrandmember(...\func_get_args());
}

public function vrange($key, $min, $max, $count = -1): \Relay\Relay|array|false
{
return $this->initializeLazyObject()->vrange(...\func_get_args());
}

public function vrem($key, $element): \Relay\Relay|false|int
{
return $this->initializeLazyObject()->vrem(...\func_get_args());
}

public function vsetattr($key, $element, $attributes): \Relay\Relay|false|int
{
return $this->initializeLazyObject()->vsetattr(...\func_get_args());
}

public function vsim($key, $member, $options = null): \Relay\Relay|array|false
{
return $this->initializeLazyObject()->vsim(...\func_get_args());
}

public function wait($replicas, $timeout): \Relay\Relay|false|int
{
return $this->initializeLazyObject()->wait(...\func_get_args());
Expand All @@ -1440,6 +1508,11 @@ public function xack($key, $group, $ids): \Relay\Relay|false|int
return $this->initializeLazyObject()->xack(...\func_get_args());
}

public function xackdel($key, $group, $ids, $mode = null): \Relay\Relay|array|false
{
return $this->initializeLazyObject()->xackdel(...\func_get_args());
}

public function xadd($key, $id, $values, $maxlen = 0, $approx = false, $nomkstream = false): \Relay\Relay|false|null|string
{
return $this->initializeLazyObject()->xadd(...\func_get_args());
Expand All @@ -1460,6 +1533,11 @@ public function xdel($key, $ids): \Relay\Relay|false|int
return $this->initializeLazyObject()->xdel(...\func_get_args());
}

public function xdelex($key, $ids, $mode = null): \Relay\Relay|array|false
{
return $this->initializeLazyObject()->xdelex(...\func_get_args());
}

public function xgroup($operation, $key = null, $group = null, $id_or_consumer = null, $mkstream = false, $entries_read = -2): mixed
{
return $this->initializeLazyObject()->xgroup(...\func_get_args());
Expand Down
Loading
Loading