Download the PHP package signakit/flags-php without Composer
On this page you can find all versions of the php package signakit/flags-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download signakit/flags-php
More information about signakit/flags-php
Files in signakit/flags-php
Package flags-php
Short Description Official PHP SDK for SignaKit Feature Flags
License MIT
Informations about the package flags-php
signakit/flags-php
Official PHP 8.1+ SDK for SignaKit Feature Flags.
- Framework-agnostic — works with Laravel, Symfony, WordPress, or plain PHP
- Evaluates flags locally (no network call per evaluation)
- MurmurHash3 bucketing for deterministic, consistent assignments
- ETag-based config caching to minimize CDN traffic
- Fire-and-forget event tracking
Installation
Guzzle is recommended but optional — the SDK falls back to cURL automatically:
Quick Start
Plain PHP
Laravel
WordPress
API Reference
SignaKitClient
| Method | Description |
|---|---|
initialize(): void |
Fetch config from CDN. Retries 3× with exponential back-off. Throws on failure. |
onReady(): void |
Alias for initialize(). |
createUserContext(string $userId, array $attributes = []): SignaKitUserContext |
Create an evaluation context for a user. |
refreshConfig(): void |
Re-fetch config (ETag-aware). Call periodically to pick up flag changes. |
SignaKitUserContext
| Method | Description |
|---|---|
decide(string $flagKey): ?Decision |
Evaluate a single flag. Returns null if the flag does not exist or is archived. |
decideAll(): array<string, Decision> |
Evaluate every active flag. Returns a map of flagKey → Decision. |
trackEvent(string $eventKey, ?float $value = null): void |
Fire a conversion event. |
Decision
Custom HTTP Client
Implement HttpClientInterface to plug in your own transport:
How It Works
-
Config delivery — On
initialize()the SDK fetches a JSON config from CloudFront (d30l2rkped5b4m.cloudfront.net). The config contains all flag definitions, rules, and allocation ranges. Subsequent calls send anIf-None-MatchETag header so unchanged configs are never re-downloaded. -
Local evaluation — All
decide()calls run entirely in memory, with no network round-trip. The two-stage MurmurHash3 bucketing algorithm guarantees deterministic, consistent assignments: the same user always gets the same variation for a given flag configuration. - Event tracking —
trackEvent()and internal$exposureevents are POSTed to an API Gateway endpoint asynchronously. Failures are logged witherror_log()and never throw.
SDK Key Format
env—prod(production) ordev(development)orgId— alphanumeric organisation IDprojectId— numeric project IDrandom— 12-character hex suffix
Requirements
- PHP 8.1+
ext-curl(for the built-in cURL client) orguzzlehttp/guzzle ^7.0
License
MIT