unleash

package module
v0.0.0-...-728bc53 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2026 License: MIT Imports: 9 Imported by: 0

README

FrankenPHP Unleash Extension

This implements a fast unleash extension that is using the Unleash go client in the background.

Installation:

CGO_ENABLED=1 \
CGO_CFLAGS="$(php-config --includes) -D_GNU_SOURCE" \
CGO_LDFLAGS="$(php-config --ldflags) $(php-config --libs)" \
xcaddy build \
    --output frankenphp \
    --with github.com/dunglas/frankenphp/caddy \
    --with github.com/dunglas/caddy-cbrotli \
    --with github.com/dunglas/mercure/caddy \
    --with github.com/dunglas/vulcain/caddy \
    --with github.com/iandenh/frankenphp-unleash

When running tests (or if you don't need file watcher support), add the nowatcher build tag to avoid linking the e-dant watcher C library:

go test -tags=nowatcher ./...

Usage

use Iandenh\Unleash\Client;

// Creating a global unleash client named 'api'. Client will be reused.
$client = Client::getOrCreate("api", "https://unleash.example.com/api", "", streamingMode: true);

// Get enabled status. Second argument is the context.
$client->isEnabled('feature_name', ['userId' => 123]);

// If needed the client can be closed (next time a new connection will be created)
$client->close();

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL