Skip to content

Commit 9df0d7c

Browse files
authored
Merge pull request #13 from launchdarkly/eb/sc-157405/php-client-5
bump Consul client dependency to 5.x in new major version
2 parents 8c9aa18 + 9bebaf8 commit 9df0d7c

File tree

6 files changed

+13
-17
lines changed

6 files changed

+13
-17
lines changed

.circleci/config.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ version: 2.1
33
workflows:
44
workflow:
55
jobs:
6-
- linux-test:
7-
name: PHP 7.3
8-
docker-image: cimg/php:7.3
96
- linux-test:
107
name: PHP 7.4
118
docker-image: cimg/php:7.4

.ldrelease/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212

1313
branches:
1414
- name: main
15+
- name: 2.x
1516
- name: 1.x
1617

1718
documentation:

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
[![CircleCI](https://circleci.com/gh/launchdarkly/php-server-sdk-consul.svg?style=svg)](https://circleci.com/gh/launchdarkly/php-server-sdk-consul)
44

5-
This library provides a [Consul](https://www.consul.io/)-backed data source for the [LaunchDarkly PHP SDK](https://github.com/launchdarkly/php-server-sdk), replacing the default behavior of querying the LaunchDarkly service endpoints. The underlying Consul client implementation is the [`sensiolabs/consul-php-sdk`](https://github.com/FriendsOfPHP/consul-php-sdk) package.
5+
This library provides a [Consul](https://www.consul.io/)-backed data source for the [LaunchDarkly PHP SDK](https://github.com/launchdarkly/php-server-sdk), replacing the default behavior of querying the LaunchDarkly service endpoints. The underlying Consul client implementation is the [`friendsofphp/consul-php-sdk`](https://github.com/FriendsOfPHP/consul-php-sdk) package.
66

77
The minimum version of the LaunchDarkly PHP SDK for use with this library is 4.0.0. In earlier versions of the SDK, the Consul integration was bundled in the main SDK package.
88

9-
This version of the package uses version 4.x of the `consul-php-sdk` client. If your application needs to use an earlier version of `consul-php-sdk`, use a 1.x version of `launchdarkly/server-sdk-consul`.
9+
This version of the package uses version 5.x of the `consul-php-sdk` client. If your application needs to use an earlier version of `consul-php-sdk`, use `launchdarkly/server-sdk-consul` 1.x (for version 2.x of `consul-php-sdk`) or `launchdarkly/server-sdk-consul` 2.x (for version 4.x of `consul-php-sdk`).
1010

11-
The minimum PHP version is 7.3.
11+
The minimum PHP version is 7.4.
1212

1313
For more information, see [our SDK documentation](https://docs.launchdarkly.com/sdk/features/storing-data).
1414

@@ -22,7 +22,7 @@ This assumes that you have already installed the LaunchDarkly PHP SDK in your pr
2222
php composer.phar install launchdarkly/server-sdk-consul --save
2323
```
2424

25-
If your project does not already have a dependency on `sensiolabs/consul-php-sdk`, that package will be loaded automatically as a dependency of `launchdarkly/server-sdk-consul`.
25+
If your project does not already have a dependency on `friendsofphp/consul-php-sdk`, that package will be loaded automatically as a dependency of `launchdarkly/server-sdk-consul`.
2626

2727
3. In your SDK configuration code, configure the Consul integration:
2828

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
}
2121
],
2222
"require": {
23-
"php": ">=7.3",
24-
"sensiolabs/consul-php-sdk": "^4",
23+
"php": ">=7.4",
24+
"friendsofphp/consul-php-sdk": "^5",
2525
"launchdarkly/server-sdk": "^4"
2626
},
2727
"require-dev": {

src/LaunchDarkly/Impl/Integrations/ConsulFeatureRequester.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
namespace LaunchDarkly\Impl\Integrations;
33

44
use LaunchDarkly\Impl\Integrations\FeatureRequesterBase;
5-
use SensioLabs\Consul\Exception\ClientException;
6-
use SensioLabs\Consul\ServiceFactory;
5+
use Consul\Exception\ClientException;
6+
use Consul\Services\KV;
77

88
/**
99
* @internal
@@ -23,8 +23,7 @@ public function __construct($baseUri, $sdkKey, $options)
2323
if (isset($options['consul_uri'])) {
2424
$consulOpts['base_uri'] = $options['consul_uri'];
2525
}
26-
$sf = new ServiceFactory($consulOpts);
27-
$this->_kvClient = $sf->get('kv');
26+
$this->_kvClient = new KV();
2827

2928
$prefix = $options['consul_prefix'] ?? null;
3029
if ($prefix === null || $prefix === '') {

tests/ConsulFeatureRequesterTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,16 @@
55
use LaunchDarkly\FeatureRequester;
66
use LaunchDarkly\Integrations\Consul;
77
use LaunchDarkly\SharedTest\DatabaseFeatureRequesterTestBase;
8-
use SensioLabs\Consul\Exception\ClientException;
9-
use SensioLabs\Consul\ServiceFactory;
8+
use Consul\Exception\ClientException;
9+
use Consul\Services\KV;
1010

1111
class ConsulFeatureRequesterTest extends DatabaseFeatureRequesterTestBase
1212
{
1313
private static $kvClient;
1414

1515
public static function setUpBeforeClass(): void
1616
{
17-
$sf = new ServiceFactory();
18-
self::$kvClient = $sf->get('kv');
17+
self::$kvClient = new KV();
1918
}
2019

2120
private static function realPrefix(?string $prefix): string

0 commit comments

Comments
 (0)