Download the PHP package harness/ff-server-sdk without Composer
On this page you can find all versions of the php package harness/ff-server-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download harness/ff-server-sdk
More information about harness/ff-server-sdk
Files in harness/ff-server-sdk
Package ff-server-sdk
Short Description PHP Server SDK for integrating with Harness Feature Flag service.
License Apache-2.0
Homepage https://github.com/harness/ff-php-server-sdk
Informations about the package ff-server-sdk
PHP SDK for Harness Feature Flags
========================
Table of Contents
Intro
Requirements
Quickstart
Further Reading
Development
Intro
Use this README to get started with our Feature Flags (FF) SDK for PHP. This guide outlines the basics of getting started with the SDK and provides a full code sample for you to try out. This sample doesn’t include configuration options, for in depth steps and configuring the SDK, for example, disabling streaming or using our Relay Proxy, see the PHP SDK Reference.
Requirements
To use this SDK, make sure you’ve:
- installed PHP 7.4 or a newer version
- installed Composer
General Dependencies
- Relay Proxy
- Redis
Quickstart
To follow along with our test code sample, make sure you’ve:
- Created a Feature Flag on the Harness Platform called
harnessappdemodarkmode
- Created a server SDK key and made a copy of it
Install the SDK Dependency
The first step is to install the SDK as a dependency in your application using Composer.
Code Sample
The following is a complete code example that you can use to test the harnessappdemodarkmode
Flag you created on the Harness Platform. When you run the code it will:
- Connect to the FF service.
- Report the value of the Flag on the webpage. Every time the
harnessappdemodarkmode
Flag is toggled on or off on the Harness Platform, the updated value will be updated when the cache refreshes, then refresh the webpage to see the new value. - Close the SDK.
The example below can also be found in online_example.php.
Running the example with docker
This project contains the resources to quickly run this code example with Docker. To do this, you will need:
- docker
- docker-compose
- make
First set up the environment configuration for both the FF Relay Proxy and the SDK.
Copy the .online.example.env
to .online.env
.
Then edit .online.env
and add the following values from your Harness configuration.
For More information on how to get the values for these fields, refer to: Relay Proxy Configuration Feature Flags SDK Keys
Once these are configured, start the docker containers with:
Once the docker containers are running, open the URL in a browser window to view the Feature Flag value.
Additional Reading
Further examples and config options are in the further reading section:
Further Reading
Harness is a feature management platform that helps teams to build better software and to test features quicker.
All versions of ff-server-sdk with dependencies
harness/ff-php-client-api Version *@dev
cache/filesystem-adapter Version ^1.2
monolog/monolog Version 2.6.0
psr/log Version 1.1.4
psr/cache Version 1.0.1
symfony/deprecation-contracts Version 2.2
gmponos/guzzle_logger Version ^2.2