🌐 AI搜索 & 代理 主页
Skip to content

Commit 29ad67b

Browse files
committed
bug #62536 [Cache] ensure compatibility with Relay extension 0.20.0 (xabbuh)
This PR was merged into the 6.4 branch. Discussion ---------- [Cache] ensure compatibility with Relay extension 0.20.0 | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | | License | MIT see https://github.com/cachewerk/relay/releases/tag/v0.20.0 Commits ------- b3d797c ensure compatibility with Relay extension 0.20.0
2 parents dd745cc + b3d797c commit 29ad67b

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Cache\Traits\Relay;
13+
14+
if (version_compare(phpversion('relay'), '0.20.0', '>=')) {
15+
/**
16+
* @internal
17+
*/
18+
trait Relay20Trait
19+
{
20+
public function _digest($value): string
21+
{
22+
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_digest(...\func_get_args());
23+
}
24+
25+
public function delex($key, $options = null): \Relay\Relay|false|int
26+
{
27+
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->delex(...\func_get_args());
28+
}
29+
30+
public function digest($key): \Relay\Relay|false|null|string
31+
{
32+
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->digest(...\func_get_args());
33+
}
34+
35+
public function msetex($kvals, $ttl = null): \Relay\Relay|false|int
36+
{
37+
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->msetx(...\func_get_args());
38+
}
39+
}
40+
} else {
41+
/**
42+
* @internal
43+
*/
44+
trait Relay20Trait
45+
{
46+
}
47+
}

src/Symfony/Component/Cache/Traits/RelayProxy.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
use Symfony\Component\Cache\Traits\Relay\Relay11Trait;
2626
use Symfony\Component\Cache\Traits\Relay\Relay121Trait;
2727
use Symfony\Component\Cache\Traits\Relay\Relay12Trait;
28+
use Symfony\Component\Cache\Traits\Relay\Relay20Trait;
2829
use Symfony\Component\Cache\Traits\Relay\SwapdbTrait;
2930
use Symfony\Component\VarExporter\LazyObjectInterface;
3031
use Symfony\Component\VarExporter\LazyProxyTrait;
@@ -58,6 +59,7 @@ class RelayProxy extends \Relay\Relay implements ResetInterface, LazyObjectInter
5859
use Relay11Trait;
5960
use Relay12Trait;
6061
use Relay121Trait;
62+
use Relay20Trait;
6163
use SwapdbTrait;
6264

6365
private const LAZY_OBJECT_PROPERTY_SCOPES = [];

0 commit comments

Comments
 (0)