Download the PHP package kameleoon/openfeature-php without Composer

On this page you can find all versions of the php package kameleoon/openfeature-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package openfeature-php

Kameleoon OpenFeature provider for PHP

The Kameleoon OpenFeature provider for PHP allows you to connect your OpenFeature PHP implementation to Kameleoon without installing the PHP Kameleoon SDK.

[!WARNING] This is a beta version. Breaking changes may be introduced before general release.

Supported PHP versions

This version of the SDK is built for the following targets:

Get started

This section explains how to install, configure, and customize the Kameleoon OpenFeature provider.

Install dependencies

First, install the required dependencies in your application.

add in composer.json

Usage

The following example shows how to use the Kameleoon provider with the OpenFeature SDK.

Customize the Kameleoon provider

You can customize the Kameleoon provider by changing the KameleoonClientConfig object that you passed to the constructor above. For example:

[!NOTE] For additional configuration options, see the Kameleoon documentation.

EvaluationContext and Kameleoon Data

Kameleoon uses the concept of associating Data to users, while the OpenFeature SDK uses the concept of an EvaluationContext, which is a dictionary of string keys and values. The Kameleoon provider maps the EvaluationContext to the Kameleoon Data.

[!NOTE] To get the evaluation for a specific visitor, set the targeting_key value for the EvaluationContext to the visitor code (user ID). If the value is not provided, then the defaultValue parameter will be returned.

The Kameleoon provider provides a few predefined parameters that you can use to target a visitor from a specific audience and track each conversion. These are:

Parameter Description
DataType::CUSTOM_DATA The parameter is used to set CustomData for a visitor.
DataType::CONVERSION The parameter is used to track a Conversion for a visitor.

DataType::CUSTOM_DATA

Use DataType::CUSTOM_DATA to set CustomData for a visitor. The DataType::CUSTOM_DATA field has the following parameters:

Parameter Type Description
CustomDataType::INDEX int Index or ID of the custom data to store. This field is mandatory.
CustomDataType::VALUES string or array Value of the custom data to store. This field is mandatory.

Example

DataType::CONVERSION

Use DataType::CONVERSION to track a Conversion for a visitor. The DataType::CONVERSION field has the following parameters:

Parameter Type Description
ConversionType::GOAL_ID int Identifier of the goal. This field is mandatory.
ConversionType::REVENUE float Revenue associated with the conversion. This field is optional.

Example

Use multiple Kameleoon Data types

You can provide many different kinds of Kameleoon data within a single EvaluationContext instance.

For example, the following code provides one DataType::CONVERSION instance and two DataType::CUSTOM_DATA instances.


All versions of openfeature-php with dependencies

PHP Build Version
Package Version
Requires open-feature/sdk Version >=2.0.8
kameleoon/kameleoon-client-php Version >=4.4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kameleoon/openfeature-php contains the following files

Loading the files please wait ....