LaunchDarkly PHP SDK Predis integration 2.0.0

Redis
in package

Integration with a Redis data store using the `predis` package.

Table of Contents

DEFAULT_PREFIX  = 'launchdarkly'
bigSegmentsStore()  : BigSegmentsStore
Configures a big segments store instance backed by Redis.
featureRequester()  : callable
Configures an adapter for reading feature flag data from Redis.

Constants

DEFAULT_PREFIX

public mixed DEFAULT_PREFIX = 'launchdarkly'

Methods

bigSegmentsStore()

Configures a big segments store instance backed by Redis.

public static bigSegmentsStore(ClientInterface $client, LoggerInterface $logger[, array<string, mixed> $options = [] ]) : BigSegmentsStore

After calling this method, store its return value in the store property of your Big Segment configuration:

$store = LaunchDarkly\Integrations\Redis::bigSegmentsStore(["prefix" => "env1"]);
$bigSegmentsConfig = new LaunchDarkly\BigSegmentConfig(store: $store);
$config = ["big_segments" => $bigSegmentsConfig];
$client = new LDClient("sdk_key", $config);
Parameters
$client : ClientInterface
$logger : LoggerInterface
$options : array<string, mixed> = []
  • prefix: a string to be prepended to all database keys; corresponds to the prefix setting in ld-relay
Return values
BigSegmentsStore

featureRequester()

Configures an adapter for reading feature flag data from Redis.

public static featureRequester(ClientInterface $client[, array<string, mixed> $options = [] ]) : callable

After calling this method, store its return value in the feature_requester property of your client configuration:

$fr = LaunchDarkly\Integrations\Redis::featureRequester(["prefix" => "env1"]);
$config = ["feature_requester" => $fr];
$client = new LDClient("sdk_key", $config);

For more about using LaunchDarkly with databases, see the SDK reference guide.

Parameters
$client : ClientInterface
$options : array<string, mixed> = []

Configuration settings (can also be passed in the main client configuration):

  • prefix: a string to be prepended to all database keys; corresponds to the prefix setting in ld-relay
Return values
callable

Search results