PHPackages                             gramzivi/flag-it-bundle - 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. gramzivi/flag-it-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

gramzivi/flag-it-bundle
=======================

Lightweight and extensible feature flags bundle for Symfony

v1.0.0-beta(10mo ago)28MITPHPPHP &gt;=8.1

Since Jul 9Pushed 10mo agoCompare

[ Source](https://github.com/Gramzivi/flag-it-bundle)[ Packagist](https://packagist.org/packages/gramzivi/flag-it-bundle)[ RSS](/packages/gramzivi-flag-it-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

FlagItBundle
============

[](#flagitbundle)

FlagItBundle is a lightweight and extensible feature flags bundle for Symfony.
It supports both simple (single-client) and advanced (multi-client) feature flag configuration. The bundle is designed to be unobtrusive and integrates cleanly with the Symfony service container.

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

[](#installation)

```
composer require gramzivi/flag-it-bundle
```

Configuration
-------------

[](#configuration)

Create a configuration file at `config/packages/flagit.yaml`.

### Simple configuration (single client)

[](#simple-configuration-single-client)

```
flagit:
    flags:
        enable_chat: true
        new_dashboard: false
```

### Advanced configuration (multiple clients)

[](#advanced-configuration-multiple-clients)

```
flagit:
    current_client: '%env(default:client_a:FLAGIT_CURRENT_CLIENT)%'

    clients:
        client_a:
            enable_chat: true
            new_dashboard: false

        client_b:
            enable_chat: false
            new_dashboard: true

    defaults:
        enable_chat: false
        new_dashboard: false
```

The `current_client` can be defined via `.env`, or as a parameter in your configuration. If neither is defined, `'default'` will be used.

Service Usage
-------------

[](#service-usage)

Inject `FeatureFlagManager` into any service or controller:

```
use FlagIt\Service\FeatureFlagManager;

class SomeService
{
    public function __construct(private FeatureFlagManager $flags) {}

    public function run(): void
    {
        if ($this->flags->isEnabled('enable_chat')) {
            // Chat logic here
        }
    }
}
```

Twig Integration
----------------

[](#twig-integration)

If Twig is installed, the `feature_flag()` function will be available automatically.

```
{% if feature_flag('enable_chat') %}
    Chat is enabled
{% endif %}
```

There is no need for manual registration. The bundle checks if Twig is available and registers the extension automatically.

Console Usage
-------------

[](#console-usage)

Use the console to inspect current flag states:

```
bin/console flagit:list
```

To list flags for a specific client:

```
bin/console flagit:list --client=client_b
```

Client Resolution Order
-----------------------

[](#client-resolution-order)

The bundle resolves the active client in the following order:

1. From the `FLAGIT_CURRENT_CLIENT` environment variable
2. From the `flagit.current_client` Symfony parameter
3. Fallback to `'default'`

Optional Service Configuration
------------------------------

[](#optional-service-configuration)

If you want to explicitly wire the client context service, you can add the following to your `services.yaml`:

```
services:
    _defaults:
        autowire: true
        autoconfigure: true

    FlagIt\:
        resource: '../src/*'
        exclude: '../src/{DependencyInjection,Entity,Tests}'

    FlagIt\Context\DefaultClientContext:
        arguments:
            $configuredClient: '%flagit.current_client%'
```

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

[](#requirements)

- PHP &gt;= 8.1
- Symfony 6.4 or 7.x

License
-------

[](#license)

MIT License

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance58

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 Bus Factor1

Top contributor holds 90.9% of commits — single point of failure

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

Every ~0 days

Total

2

Last Release

303d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/04022a50faf1b7b980330a23a1abd13857d18f2db338355d6ef6ffb12a84cd6e?d=identicon)[Gramzivi](/maintainers/Gramzivi)

---

Top Contributors

[![Gramzivi](https://avatars.githubusercontent.com/u/4395951?v=4)](https://github.com/Gramzivi "Gramzivi (10 commits)")[![deepsource-io[bot]](https://avatars.githubusercontent.com/in/16372?v=4)](https://github.com/deepsource-io[bot] "deepsource-io[bot] (1 commits)")

### Embed Badge

![Health badge](/badges/gramzivi-flag-it-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/gramzivi-flag-it-bundle/health.svg)](https://phpackages.com/packages/gramzivi-flag-it-bundle)
```

###  Alternatives

[winzou/state-machine-bundle

Bundle for the very lightweight yet powerful PHP state machine

34010.4M15](/packages/winzou-state-machine-bundle)[stfalcon/tinymce-bundle

This Bundle integrates TinyMCE WYSIWYG editor into a Symfony2 project.

2692.9M24](/packages/stfalcon-tinymce-bundle)[sylius/taxonomy-bundle

Flexible categorization system for Symfony.

26388.2k7](/packages/sylius-taxonomy-bundle)[symfony/ai-bundle

Integration bundle for Symfony AI components

30282.3k6](/packages/symfony-ai-bundle)[sylius/addressing-bundle

Addressing and zone management for Symfony applications.

33221.4k3](/packages/sylius-addressing-bundle)[sylius/inventory-bundle

Flexible inventory management for Symfony applications.

19176.7k4](/packages/sylius-inventory-bundle)

PHPackages © 2026

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