LaunchDarkly Server-side SDK for PHP
The latest version of this SDK supports the ability to manage migrations or modernizations, using migration flags. You might use this functionality if you are optimizing queries, upgrading to new tech stacks, migrating from one database to another, or other similar technology changes. Migration flags are part of LaunchDarkly's Early Access Program. This feature is available to all LaunchDarkly customers but may undergo additional changes before it is finalized.
For detailed information about this version, refer to the list below. For information on how to upgrade from the previous version, read the migration guide.
Migrator
type which provides an out-of-the-box configurable migration framework.migrationVariation
and trackMigrationOperation
methods on LDClient
.LDContext
or an LDUser
now only accept an LDContext
.variationForAllUsers
, valueForAllUsers
, and clearUserTargets
have been removed.The latest version of this SDK supports LaunchDarkly's new custom contexts feature. Contexts are an evolution of a previously-existing concept, "users." Contexts let you create targeting rules for feature flags based on a variety of different information, including attributes pertaining to users, organizations, devices, and more. You can even combine contexts to create "multi-contexts."
This feature is only available to members of LaunchDarkly's Early Access Program (EAP). If you're in the EAP, you can use contexts by updating your SDK to the latest version and, if applicable, updating your Relay Proxy. Outdated SDK versions do not support contexts, and will cause unpredictable flag evaluation behavior.
If you are not in the EAP, only use single contexts of kind "user", or continue to use the user type if available. If you try to create contexts, the context will be sent to LaunchDarkly, but any data not related to the user object will be ignored.
For detailed information about this version, please refer to the list below. For information on how to upgrade from the previous version, please read the migration guide.
LDContext
defines the new "context" model. "Contexts" are a replacement for the earlier concept of "users"; they can be populated with attributes in more or less the same way as before, but they also support new behaviors. To learn more, read the documentation.LDUser
parameter, the parameter type can now be either LDUser
or LDContext
. The SDK still supports LDUser
for now, but LDContext
is the preferred model and LDUser
may be removed in a future version.secondary
meta-attribute that affects percentage rollouts. If you set an attribute with that name in LDContext
, it will simply be a custom attribute like any other.EventPublisher
and FeatureRequester
which applications are unlikely to reference directly (except when defining a custom component implementation) have been moved out of the main namespace into a new namespace, LaunchDarkly\Subsystems
.secondary
meta-attribute in LDUser
and LDUserBuilder
.alias
method no longer exists because alias events are not needed in the new context model.inline_users_in_events
option no longer exists because it is not relevant in the new context model.