Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc7f40f3

Browse files
bug#53054 [Cache] Fix expiration time for CouchbaseCollection (alexandre-daubois)
This PR was merged into the 6.3 branch.Discussion----------[Cache] Fix expiration time for CouchbaseCollection| Q | A| ------------- | ---| Branch? | 6.3| Bug fix? | yes| New feature? | no| Deprecations? | no| Issues | -| License | MITA refactoring has been done in Couchbase extension 3.0.5 about expiry time:https://github.com/couchbase/php-couchbase/releases/tag/v3.0.5 (see PCBC-715)In order to put things together, let's constantly use an absolute time point here. This also fixes a failing test of integration tests in 6.3.Tests skipping messages have been updated to match `CouchbaseCollectionAdapter::isSupported()`.Commits-------e286f38 [Cache] Fix expiration time for CouchbaseCollection
2 parents64f6ac2 +e286f38 commitc7f40f3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

‎src/Symfony/Component/Cache/Adapter/CouchbaseCollectionAdapter.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class CouchbaseCollectionAdapter extends AbstractAdapter
3535
publicfunction__construct(Collection$connection,string$namespace ='',int$defaultLifetime =0,MarshallerInterface$marshaller =null)
3636
{
3737
if (!static::isSupported()) {
38-
thrownewCacheException('Couchbase >= 3.0.0 < 4.0.0 is required.');
38+
thrownewCacheException('Couchbase >= 3.0.5 < 4.0.0 is required.');
3939
}
4040

4141
$this->maxIdLength =static::MAX_KEY_LENGTH;
@@ -54,7 +54,7 @@ public static function createConnection(#[\SensitiveParameter] array|string $dsn
5454
}
5555

5656
if (!static::isSupported()) {
57-
thrownewCacheException('Couchbase >= 3.0.0 < 4.0.0 is required.');
57+
thrownewCacheException('Couchbase >= 3.0.5 < 4.0.0 is required.');
5858
}
5959

6060
set_error_handler(function ($type,$msg,$file,$line):bool {thrownew \ErrorException($msg,0,$type,$file,$line); });
@@ -183,7 +183,7 @@ protected function doSave(array $values, $lifetime): array|bool
183183
}
184184

185185
$upsertOptions =newUpsertOptions();
186-
$upsertOptions->expiry($lifetime);
186+
$upsertOptions->expiry(time() +$lifetime);
187187

188188
$ko = [];
189189
foreach ($valuesas$key =>$value) {

‎src/Symfony/Component/Cache/Tests/Adapter/CouchbaseCollectionAdapterTest.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
/**
2020
* @requires extension couchbase <4.0.0
21-
* @requires extension couchbase >=3.0.0
21+
* @requires extension couchbase >=3.0.5
2222
*
2323
* @group integration
2424
*
@@ -36,7 +36,7 @@ class CouchbaseCollectionAdapterTest extends AdapterTestCase
3636
publicstaticfunctionsetUpBeforeClass():void
3737
{
3838
if (!CouchbaseCollectionAdapter::isSupported()) {
39-
self::markTestSkipped('Couchbase >= 3.0.0 < 4.0.0 is required.');
39+
self::markTestSkipped('Couchbase >= 3.0.5 < 4.0.0 is required.');
4040
}
4141

4242
self::$client = AbstractAdapter::createConnection('couchbase://'.getenv('COUCHBASE_HOST').'/cache',
@@ -47,7 +47,7 @@ public static function setUpBeforeClass(): void
4747
publicfunctioncreateCachePool($defaultLifetime =0):CacheItemPoolInterface
4848
{
4949
if (!CouchbaseCollectionAdapter::isSupported()) {
50-
self::markTestSkipped('Couchbase >= 3.0.0 < 4.0.0 is required.');
50+
self::markTestSkipped('Couchbase >= 3.0.5 < 4.0.0 is required.');
5151
}
5252

5353
$client =$defaultLifetime

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp