PHPackages                             rollercoders/flagforge-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. rollercoders/flagforge-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rollercoders/flagforge-php
==========================

PHP client for FlagForge feature flagging

0.1.0(1mo ago)00MITPHP &gt;=8.1

Since Jul 6Compare

[ Source](https://github.com/Rollercoders/flagforge-php)[ Packagist](https://packagist.org/packages/rollercoders/flagforge-php)[ Docs](https://github.com/Rollercoders/flagforge-php)[ RSS](/packages/rollercoders-flagforge-php/feed)WikiDiscussions Synced 1w ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

flagforge-php
=============

[](#flagforge-php)

PHP client for [FlagForge](https://flagforge.dev) feature flags. Zero external dependencies, uses cURL.

Installation
------------

[](#installation)

```
composer require rollercoders/flagforge-php
```

Usage
-----

[](#usage)

### Initialization

[](#initialization)

```
use FlagForge\FlagForgeClient;

$client = new FlagForgeClient([
    'host'    => 'https://flagforge.myapp.com',
    'api_key' => 'ff_xxxx',
    'timeout' => 5, // optional, default 5 seconds
]);
```

### isEnabled

[](#isenabled)

Checks whether a feature flag is enabled for a user with optional attributes. Throws `FlagForgeException` on error.

```
$enabled = $client->isEnabled('new-dashboard', [
    'userId'     => 'user-123',
    'attributes' => ['plan' => 'premium'],
]);

if ($enabled) {
    // show the new dashboard
}
```

### isEnabledSafe

[](#isenabledsafe)

Like `isEnabled`, but returns `false` instead of throwing an exception on error.

```
$enabled = $client->isEnabledSafe('new-dashboard', ['userId' => 'user-123']);

if ($enabled) {
    // show the new dashboard
}
```

### evaluateMany

[](#evaluatemany)

Evaluates multiple flags at once for a user. Returns an associative array `flag => bool`.

```
$results = $client->evaluateMany(['flag-a', 'flag-b'], ['userId' => 'user-123']);
// Returns: ['flag-a' => true, 'flag-b' => false]

foreach ($results as $flag => $enabled) {
    echo "$flag: " . ($enabled ? 'ON' : 'OFF') . PHP_EOL;
}
```

### evaluateAll

[](#evaluateall)

Evaluates all available flags for a user. Returns an associative array `flag => bool`.

```
$results = $client->evaluateAll(['userId' => 'user-123']);

foreach ($results as $flag => $enabled) {
    echo "$flag: " . ($enabled ? 'ON' : 'OFF') . PHP_EOL;
}
```

Error handling
--------------

[](#error-handling)

`FlagForge\FlagForgeException` is thrown by `isEnabled` and `evaluateMany`/`evaluateAll` in the following cases:

- Connection error (cURL)
- Invalid HTTP response from the server
- Malformed JSON response

Use `isEnabledSafe` to avoid exceptions in critical parts of your application:

```
use FlagForge\FlagForgeException;

try {
    $enabled = $client->isEnabled('new-dashboard', ['userId' => 'user-123']);
} catch (FlagForgeException $e) {
    // handle the error
    error_log('FlagForge error: ' . $e->getMessage());
    $enabled = false;
}
```

Requirements
------------

[](#requirements)

- PHP 8.1+
- ext-curl

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance90

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

48d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b742fee166c8597ef829255fba9e210af73c94b62e2e7852808188ece1c36341?d=identicon)[TheFe91](/maintainers/TheFe91)

---

Tags

sdkfeature-flagsfeature-togglesflagforge

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rollercoders-flagforge-php/health.svg)

```
[![Health](https://phpackages.com/badges/rollercoders-flagforge-php/health.svg)](https://phpackages.com/packages/rollercoders-flagforge-php)
```

###  Alternatives

[aws/aws-crt-php

AWS Common Runtime for PHP

424340.7M11](/packages/aws-aws-crt-php)[friendsofcat/laravel-feature-flag

Feature Flags for Laravel

311.2M](/packages/friendsofcat-laravel-feature-flag)[offload-project/laravel-toggle

A simple and flexible feature toggle (feature flag) package for Laravel

282.7k](/packages/offload-project-laravel-toggle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
