1. Go to this page and download the library: Download aubes/openfeature-bundle 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/ */
aubes / openfeature-bundle example snippets
class CheckoutController
{
#[FeatureGate('new_checkout')]
public function checkout(
#[FeatureFlag('dark_mode')] bool $darkMode,
#[FeatureFlag('max_items')] int $maxItems,
): Response {
// values resolved from your feature flag provider
}
}
use OpenFeature\interfaces\flags\Client;
class MyService
{
public function __construct(private readonly Client $client) {}
public function checkout(): void
{
if ($this->client->getBooleanValue('new_checkout', false)) {
// new flow
}
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.