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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址