You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,20 @@
2
2
3
3
All notable changes to the LaunchDarkly PHP SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).
4
4
5
+
## [3.5.0] - 2019-01-30
6
+
### Added:
7
+
- It is now possible to use Consul or DynamoDB as a data store with `ld-relay`, similar to the existing Redis integration. See `LaunchDarkly\Integrations\Consul` and `LaunchDarkly\Integrations\DynamoDb`, and the reference guide [Using a persistent feature store](https://docs.launchdarkly.com/v2.0/docs/using-a-persistent-feature-store).
8
+
- When using the Redis integration, you can specify a Redis connection timeout different from the default of 5 seconds by setting the option `redis_timeout` to the desired number of seconds. (Thanks, [jjozefowicz](https://github.com/launchdarkly/php-client/pull/113)!)
9
+
- It is now possible to inject feature flags into the client from local JSON files, replacing the normal LaunchDarkly connection. This would typically be for testing purposes. See `LaunchDarkly\Integrations\Files`.
10
+
- The `allFlagsState` method now accepts a new option, `detailsOnlyForTrackedFlags`, which reduces the size of the JSON representation of the flag state by omitting some metadata. Specifically, it omits any data that is normally used for generating detailed evaluation events if a flag does not have event tracking or debugging turned on.
11
+
12
+
### Changed:
13
+
- The `feature_requester` and `event_publisher` configuration options now work differently: you can still set them to an instance of an implementation object, but you can also set them to a class or a class name (i.e. the same as the `feature_requester_class` option), or a factory function. Therefore, the `_class` versions of these options are no longer necessary. However, the old semantics still work, so you can for instance set `event_publisher_class` to `"LaunchDarkly\GuzzleEventPublisher"`, even though the new preferred way is to set `event_publisher` to `LaunchDarkly\Integrations\Guzzle::featureRequester()`.
14
+
15
+
### Fixed:
16
+
- JSON data from `allFlagsState` is now slightly smaller even if you do not use the new option described above, because it omits the flag property for event tracking unless that property is true.
17
+
- The `$_anonymous` property of the `LDUser` class was showing up as public rather than protected. (Thanks, [dstockto](https://github.com/launchdarkly/php-client/pull/114)!)
18
+
5
19
## [3.4.1] - 2018-09-25
6
20
### Fixed:
7
21
- Improved the performance of `allFlags`/`allFlagsState` by not making redundant individual requests for prerequisite flags, when a flag is being evaluated that has prerequisites. Instead it will reuse the same flag data that it already obtained from LaunchDarkly in the "get all the flags" request.
Copy file name to clipboardExpand all lines: README.md
+53-15Lines changed: 53 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -64,33 +64,71 @@ With Guzzle, you could persist your cache somewhere other than the default in-me
64
64
Using LD-Relay
65
65
==============
66
66
67
-
The LaunchDarkly Relay Proxy ([ld-relay](https://github.com/launchdarkly/ld-relay)) consumes the LaunchDarkly streaming API and can update
68
-
a Redis cache operating in your production environment. The ld-relay offers many benefits such as performance and feature flag consistency. With PHP applications, we strongly recommend setting up ld-relay with a Redis store.
67
+
The LaunchDarkly Relay Proxy ([ld-relay](https://github.com/launchdarkly/ld-relay)) consumes the LaunchDarkly streaming API and can update a database cache operating in your production environment. The ld-relay offers many benefits such as performance and feature flag consistency. With PHP applications, we strongly recommend setting up ld-relay with a database store. The database can be Redis, Consul, or DynamoDB. (For more about using LaunchDarkly with databases, see the [SDK reference guide](https://docs.launchdarkly.com/v2.0/docs/using-a-persistent-feature-store).)
69
68
70
69
1. Set up ld-relay in [daemon-mode](https://github.com/launchdarkly/ld-relay#redis-storage-and-daemon-mode) with Redis
71
70
72
-
2. Require Predis as a dependency:
71
+
2. Add the necessary dependency for the chosen database.
72
+
73
+
For Redis:
73
74
74
75
php composer.phar require "predis/predis:1.0.*"
75
76
76
-
3. Create the LDClient with the Redis feature requester as an option:
'redis_host' => 'your.redis.host', // defaults to "localhost" if not specified
92
+
'redis_port' => 6379, // defaults to 6379 if not specified
93
+
'redis_timeout' => 5, // connection timeout in seconds; defaults to 5
94
+
'redis_prefix' => 'env1' // corresponds to the prefix setting in ld-relay
95
+
'predis_client' => $myClient // use this if you have already configured a Predis client instance
82
96
]);
83
97
84
-
4. If ld-relay is configured for [event forwarding](https://github.com/launchdarkly/ld-relay#event-forwarding), you can configure the LDClient to publish events to ld-relay instead of directly to `events.launchdarkly.com`. Using `GuzzleEventPublisher` with ld-relay event forwarding can be an efficient alternative to the default `curl`-based event publishing.
98
+
For Consul:
85
99
86
100
$client = new LaunchDarkly\LDClient("your_sdk_key", [
'dynamodb_prefix' => 'env1', // corresponds to the prefix setting in ld-relay
114
+
'dynamodb_options' => array(), // you may pass any options supported by the AWS SDK
115
+
'apc_expiration' => 30 // expiration time for local caching, if you have apcu installed
116
+
]);
117
+
118
+
4. If you are using DynamoDB, you must create your table manually. It must have a partition key called "namespace", and a sort key called "key" (both strings). Note that by default the AWS SDK will attempt to get your AWS credentials and region from environment variables and/or local configuration files, but you may also specify them in `dynamodb_options`.
119
+
120
+
5. If ld-relay is configured for [event forwarding](https://github.com/launchdarkly/ld-relay#event-forwarding), you can configure the LDClient to publish events to ld-relay instead of directly to `events.launchdarkly.com`. Using the `Guzzle` implementation of event publishing with ld-relay event forwarding can be an efficient alternative to the default `curl`-based event publishing.
121
+
122
+
To forward events, add the following configuration properties to the configuration shown above:
For testing purposes, the SDK can be made to read feature flag state from a file or files instead of connecting to LaunchDarkly. See [`LaunchDarkly\Integrations\Files`](https://github.com/launchdarkly/php-client/blob/master/src/LaunchDarkly/Integrations/Files.php) and ["Reading flags from a file"](https://docs.launchdarkly.com/docs/reading-flags-from-a-file).
131
+
94
132
Testing
95
133
-------
96
134
@@ -107,7 +145,7 @@ Contributing
107
145
We encourage pull-requests and other contributions from the community. We've also published an [SDK contributor's guide](http://docs.launchdarkly.com/docs/sdk-contributors-guide) that provides a detailed explanation of how our SDKs work.
108
146
109
147
About LaunchDarkly
110
-
-----------
148
+
------------------
111
149
112
150
* LaunchDarkly is a continuous delivery platform that provides feature flags as a service and allows developers to iterate quickly and safely. We allow you to easily flag your features and manage them from the LaunchDarkly dashboard. With LaunchDarkly, you can:
113
151
* Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group), gathering feedback and bug reports from real-world use cases.
0 commit comments