Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Cache] Deprecate CouchbaseBucketAdapter, use CouchbaseCollectionAdapter #52974

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 13, 2023
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
5 changes: 5 additions & 0 deletions UPGRADE-7.1.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
UPGRADE FROM 7.0 to 7.1
=======================

Cache
-----

* Deprecate `CouchbaseBucketAdapter`, use `CouchbaseCollectionAdapter` instead

Messenger
---------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@
use Symfony\Component\Cache\Marshaller\DefaultMarshaller;
use Symfony\Component\Cache\Marshaller\MarshallerInterface;

trigger_deprecation('symfony/cache', '7.1', 'The "%s" class is deprecated, use "%s" instead.', CouchbaseBucketAdapter::class, CouchbaseCollectionAdapter::class);

/**
* @author Antonio Jose Cerezo Aranda <[email protected]>
*
* @deprecated since Symfony 7.1, use {@see CouchbaseCollectionAdapter} instead
*/
class CouchbaseBucketAdapter extends AbstractAdapter
{
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/Cache/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CHANGELOG
---

* Add option `sentinel_master` as an alias for `redis_sentinel`
* Deprecate `CouchbaseBucketAdapter`, use `CouchbaseCollectionAdapter`

7.0
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,33 @@
namespace Symfony\Component\Cache\Tests\Adapter;

use Psr\Cache\CacheItemPoolInterface;
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
use Symfony\Component\Cache\Adapter\AbstractAdapter;
use Symfony\Component\Cache\Adapter\CouchbaseBucketAdapter;

/**
* @requires extension couchbase <3.0.0
* @requires extension couchbase >=2.6.0
*
* @group integration
* @group integration legacy
*
* @author Antonio Jose Cerezo Aranda <[email protected]>
*/
class CouchbaseBucketAdapterTest extends AdapterTestCase
{
use ExpectDeprecationTrait;

protected $skippedTests = [
'testClearPrefix' => 'Couchbase cannot clear by prefix',
];

protected static \CouchbaseBucket $client;
protected \CouchbaseBucket $client;

public static function setupBeforeClass(): void
protected function setUp(): void
{
if (!CouchbaseBucketAdapter::isSupported()) {
self::markTestSkipped('Couchbase >= 2.6.0 < 3.0.0 is required.');
}
$this->expectDeprecation('Since symfony/cache 7.1: The "Symfony\Component\Cache\Adapter\CouchbaseBucketAdapter" class is deprecated, use "Symfony\Component\Cache\Adapter\CouchbaseCollectionAdapter" instead.');

self::$client = AbstractAdapter::createConnection('couchbase://'.getenv('COUCHBASE_HOST').'/cache',
$this->client = AbstractAdapter::createConnection('couchbase://'.getenv('COUCHBASE_HOST').'/cache',
['username' => getenv('COUCHBASE_USER'), 'password' => getenv('COUCHBASE_PASS')]
);
}
Expand All @@ -50,7 +51,7 @@ public function createCachePool($defaultLifetime = 0): CacheItemPoolInterface
.':'.getenv('COUCHBASE_PASS')
.'@'.getenv('COUCHBASE_HOST')
.'/cache')
: self::$client;
: $this->client;

return new CouchbaseBucketAdapter($client, str_replace('\\', '.', __CLASS__), $defaultLifetime);
}
Expand Down