Download the PHP package optimizely/optimizely-sdk without Composer
On this page you can find all versions of the php package optimizely/optimizely-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download optimizely/optimizely-sdk
More information about optimizely/optimizely-sdk
Files in optimizely/optimizely-sdk
Package optimizely-sdk
Short Description Optimizely PHP SDK for Optimizely Feature Experimentation, Optimizely Full Stack (legacy), and Optimizely Rollouts
License Apache-2.0
Informations about the package optimizely-sdk
Optimizely PHP SDK
This repository houses the PHP SDK for use with Optimizely Feature Experimentation and Optimizely Full Stack (legacy).
Optimizely Feature Experimentation is an A/B testing and feature management tool for product development teams that enables you to experiment at every step. Using Optimizely Feature Experimentation allows for every feature on your roadmap to be an opportunity to discover hidden insights. Learn more at Optimizely.com, or see the developer documentation.
Optimizely Rollouts is free feature flags for development teams. You can easily roll out and roll back features in any application without code deploys, mitigating risk for every feature on your roadmap.
Get Started
Refer to the PHP SDK's developer documentation for detailed instructions on getting started with using the SDK.
Requirements
To access the Feature Management configuration in the Optimizely dashboard, please contact your Optimizely account executive.
SDK version 4.0.0 requires PHP8+. SDK version 3 requires PHP5.5+ up to PHP7.
Install the SDK
The Optimizely PHP SDK can be installed through Composer. Please use the following command:
Use the PHP SDK
Initialization
Create the Optimizely client, for example:
Or you may also use OptimizelyFactory method to create an optimizely client using your SDK key, an optional fallback datafile and an optional datafile access token. Using this method internally creates an HTTPProjectConfigManager. See HTTPProjectConfigManager for further detail.
To access your HTTPProjectConfigManager:
Or you can also provide an implementation of the ProjectConfigManagerInterface
in the constructor:
ProjectConfigManagerInterface
ProjectConfigManagerInterface
exposes getConfig
method for retrieving ProjectConfig
instance.
HTTPProjectConfigManager
HTTPProjectConfigManager
is an implementation of ProjectConfigManagerInterface
interface.
The fetch
method makes a blocking HTTP GET request to the configured URL to download the
project datafile and initialize an instance of the ProjectConfig.
Calling fetch
will update the internal ProjectConfig instance that will be returned by getConfig
.
Use HTTPProjectConfigManager
SDK key
Optimizely project SDK key; required unless source URL is overridden.
A notification will be triggered whenever a new datafile is fetched and ProjectConfig is updated. To subscribe to these notifications, use the $notificationCenter->addNotificationListener(NotificationType::OPTIMIZELY_CONFIG_UPDATE, $updateCallback)
.
SDK Development
Unit Tests
You can run all unit tests with:
Contributing
Please see CONTRIBUTING.
Other Optimizely SDKs
All versions of optimizely-sdk with dependencies
guzzlehttp/guzzle Version >=6.2
justinrainbow/json-schema Version ^1.6 || ^2.0 || ^4.0 || ^5.0
lastguest/murmurhash Version ^1.3.0
monolog/monolog Version >=1.21