Download the PHP package open-feature/go-feature-flag-provider without Composer
On this page you can find all versions of the php package open-feature/go-feature-flag-provider. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download open-feature/go-feature-flag-provider
More information about open-feature/go-feature-flag-provider
Files in open-feature/go-feature-flag-provider
Package go-feature-flag-provider
Short Description The GO Feature Flag provider package for open-feature
License Apache-2.0
Informations about the package go-feature-flag-provider
GO Feature Flag - OpenFeature PHP provider
This repository contains the official PHP OpenFeature provider for accessing your feature flags with GO Feature Flag.
In conjunction with the OpenFeature SDK you will be able to evaluate your feature flags in your Ruby applications.
For documentation related to flags management in GO Feature Flag, refer to the GO Feature Flag documentation website.
Functionalities:
- Manage the integration of the OpenFeature PHP SDK and GO Feature Flag relay-proxy.
Dependency Setup
Composer
Getting started
Initialize the provider
The GoFeatureFlagProvider
takes a config object as parameter to be initialized.
The constructor of the config object has the following options:
Option | Description |
---|---|
endpoint |
(mandatory) The URL to access to the relay-proxy. (example: https://relay.proxy.gofeatureflag.org/ ) |
apiKey |
The token used to call the relay proxy. |
customHeaders |
Any headers you want to add to call the relay-proxy. |
httpclient |
The HTTP Client to use (if you want to use a custom one). It has to be a PSR-7 compliant implementation. |
The only required option to create a GoFeatureFlagProvider
is the URL (endpoint
) to your GO Feature Flag relay-proxy instance.
The evaluation context is the way for the client to specify contextual data that GO Feature Flag uses to evaluate the feature flags, it allows to define rules on the flag.
The targeting_key
is mandatory for GO Feature Flag to evaluate the feature flag, it could be the id of a user, a session ID or anything you find relevant to use as identifier during the evaluation.
Evaluate a feature flag
The client is used to retrieve values for the current EvaluationContext
.
For example, retrieving a boolean value for the flag "my-flag":
GO Feature Flag supports different all OpenFeature supported types of feature flags, it means that you can use all the accessor directly
Features status
Status | Feature | Description |
---|---|---|
✅ | Flag evaluation | It is possible to evaluate all the type of flags |
❌ | Caching | Mechanism is in place to refresh the cache in case of configuration change |
❌ | Event Streaming | Not supported by the SDK |
❌ | Logging | Not supported by the SDK |
❌ | Flag Metadata | Not supported by the SDK |
Implemented: ✅ | In-progress: ⚠️ | Not implemented yet: ❌
Contributing
This project welcomes contributions from the community. If you're interested in contributing, see the contributors' guide for some helpful tips.
PHP Versioning
This library targets PHP version 8.0 and newer. As long as you have any compatible version of PHP on your system you should be able to utilize the OpenFeature SDK.
This package also has a .tool-versions file for use with PHP version managers like asdf.
Installation and Dependencies
Install dependencies with composer install
, it will update the composer.lock
with the most recent compatible versions.
We value having as few runtime dependencies as possible. The addition of any dependencies requires careful consideration and review.
All versions of go-feature-flag-provider with dependencies
guzzlehttp/guzzle Version ^7.9
open-feature/sdk Version ^2.0
psr/http-message Version ^2.0