Skip to content

Commit fcbf0bf

Browse files
committed
Display debug info
1 parent 3e90720 commit fcbf0bf

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

.github/workflows/tests.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,12 @@ jobs:
9393

9494
- name: Install system dependencies
9595
run: |
96-
echo "::group::add apt sources"
97-
sudo wget -O - http://packages.couchbase.com/ubuntu/couchbase.key | sudo apt-key add -
98-
echo "deb http://packages.couchbase.com/ubuntu bionic bionic/main" | sudo tee /etc/apt/sources.list.d/couchbase.list
99-
echo "::endgroup::"
100-
10196
echo "::group::apt-get update"
10297
sudo apt-get update
10398
echo "::endgroup::"
10499
105100
echo "::group::install tools & libraries"
106-
sudo apt-get install libcouchbase-dev librdkafka-dev
101+
sudo apt-get install librdkafka-dev
107102
echo "::endgroup::"
108103
109104
- name: Configure Couchbase
@@ -122,6 +117,11 @@ jobs:
122117
php-version: "${{ matrix.php }}"
123118
tools: pecl
124119

120+
- name: Display versions
121+
run: |
122+
php -r 'foreach (get_loaded_extensions() as $extension) echo $extension . " " . phpversion($extension) . PHP_EOL;'
123+
php -i
124+
125125
- name: Load fixtures
126126
uses: docker://bitnami/openldap
127127
with:

src/Symfony/Component/Cache/Adapter/CouchbaseBucketAdapter.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class CouchbaseBucketAdapter extends AbstractAdapter
4242
public function __construct(\CouchbaseBucket $bucket, string $namespace = '', int $defaultLifetime = 0, MarshallerInterface $marshaller = null)
4343
{
4444
if (!static::isSupported()) {
45-
throw new CacheException('Couchbase >= 2.6.0 is required.');
45+
throw new CacheException('Couchbase >= 2.6.0 < 3.0.0 is required.');
4646
}
4747

4848
$this->maxIdLength = static::MAX_KEY_LENGTH;
@@ -66,7 +66,7 @@ public static function createConnection($servers, array $options = []): \Couchba
6666
}
6767

6868
if (!static::isSupported()) {
69-
throw new CacheException('Couchbase >= 2.6.0 is required.');
69+
throw new CacheException('Couchbase >= 2.6.0 < 3.0.0 is required.');
7070
}
7171

7272
set_error_handler(function ($type, $msg, $file, $line) { throw new \ErrorException($msg, 0, $type, $file, $line); });
@@ -125,7 +125,7 @@ public static function createConnection($servers, array $options = []): \Couchba
125125

126126
public static function isSupported(): bool
127127
{
128-
return \extension_loaded('couchbase') && version_compare(phpversion('couchbase'), '2.6.0', '>=');
128+
return \extension_loaded('couchbase') && version_compare(phpversion('couchbase'), '2.6.0', '>=') && version_compare(phpversion('couchbase'), '3.0', '<');
129129
}
130130

131131
private static function getOptions(string $options): array

src/Symfony/Component/Cache/Tests/Adapter/CouchbaseBucketAdapterTest.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
use Symfony\Component\Cache\Adapter\CouchbaseBucketAdapter;
1717

1818
/**
19-
* @requires extension couchbase 2.6.0
19+
* @requires extension couchbase <3.0.0
20+
* @requires extension couchbase >=2.6.0
2021
* @group integration
2122
*
2223
* @author Antonio Jose Cerezo Aranda <aj.cerezo@gmail.com>
@@ -32,6 +33,10 @@ class CouchbaseBucketAdapterTest extends AdapterTestCase
3233

3334
public static function setupBeforeClass(): void
3435
{
36+
if (!CouchbaseBucketAdapter::isSupported()) {
37+
self::markTestSkipped('Couchbase >= 2.6.0 < 3.0.0 is required.');
38+
}
39+
3540
self::$client = AbstractAdapter::createConnection('couchbase://'.getenv('COUCHBASE_HOST').'/cache',
3641
['username' => getenv('COUCHBASE_USER'), 'password' => getenv('COUCHBASE_PASS')]
3742
);

0 commit comments

Comments
 (0)