11<?php
22namespace LaunchDarkly \Integrations ;
33
4- use \ LaunchDarkly \Impl \Integrations \DynamoDbFeatureRequester ;
4+ use LaunchDarkly \Impl \Integrations \DynamoDbFeatureRequester ;
55
66class DynamoDb
77{
@@ -10,9 +10,16 @@ class DynamoDb
1010 *
1111 * After calling this method, store its return value in the `feature_requester` property of your client configuration:
1212 *
13- * $fr = LaunchDarkly\Integrations\DynamoDb::featureRequester([ "dynamodb_table" => "my-table" ]);
14- * $config = [ "feature_requester" => $fr ];
15- * $client = new LDClient("sdk_key", $config);
13+ * $fr = LaunchDarkly\Integrations\DynamoDb::featureRequester([ 'dynamodb_table' => 'my-table' ]);
14+ * $config = [ 'feature_requester' => $fr ];
15+ * $client = new LDClient('sdk_key', $config);
16+ *
17+ * Or if you already have a client instance:
18+ *
19+ * $dynamoClient = new Aws\DynamoDb\DynamoDbClient($settings);
20+ * $fr = LaunchDarkly\Integrations\DynamoDb::featureRequester([ 'dynamo_client' => $dynamoClient ]);
21+ * $config = [ 'feature_requester' => $fr ];
22+ * $client = new LDClient('sdk_key', $config);
1623 *
1724 * For more about using LaunchDarkly with databases, see the
1825 * [SDK reference guide](https://docs.launchdarkly.com/v2.0/docs/using-a-persistent-feature-store).
@@ -22,10 +29,12 @@ class DynamoDb
2229 * - `dynamodb_options`: can include any settings supported by the AWS SDK client
2330 * - `dynamodb_prefix`: a string to be prepended to all database keys; corresponds to the prefix
2431 * setting in ld-relay
32+ * - `dynamodb_client`: an already-configured DynamoDb client instance if you wish to reuse one; if
33+ * specified, this will cause all other options except `dynamodb_prefix` and `dynamodb_table` to be ignored
2534 * - `apc_expiration`: expiration time in seconds for local caching, if `APCu` is installed
26- * @return mixed an object to be stored in the `feature_requester` configuration property
35+ * @return \Closure an object to be stored in the `feature_requester` configuration property
2736 */
28- public static function featureRequester (array $ options = array () )
37+ public static function featureRequester (array $ options = [] )
2938 {
3039 return function ($ baseUri , $ sdkKey , $ baseOptions ) use ($ options ) {
3140 return new DynamoDbFeatureRequester ($ baseUri , $ sdkKey , array_merge ($ baseOptions , $ options ));
0 commit comments