1. Go to this page and download the library: Download open-feature/split-provider library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$client = $api->getClient('split-example', '1.0.0');
$featureEnabled = $client->getBooleanDetails('dev.openfeature.example_flag', false, new EvaluationContext('user-id'), null);
if ($featureEnabled) {
// do new logic here
} else {
// do old logic here
}
$client = $api->getClient('split-example', '1.0.0');
$featureEnabled = $client->getBooleanDetails('dev.openfeature.example_flag', false, new EvaluationContext('user-id', [
'plan_type' => 'growth',
'registered_date' => (new DateTime('now', new DateTimeZone('UTC')))->getTimestamp(),
'deal_size' => 10000,
'paying_customer' => True,
'permissions' => ['gold','silver','platinum'],
]), null);
if ($featureEnabled) {
// do new logic here
} else {
// do old logic here
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.