https://github.com/bestit/flagception-bundle
Feature flags on steroids!
https://github.com/bestit/flagception-bundle
bundle constraints feature feature-flags feature-toggles rollout symfony toggle
Last synced: 2 months ago
JSON representation
Feature flags on steroids!
- Host: GitHub
- URL: https://github.com/bestit/flagception-bundle
- Owner: bestit
- License: mit
- Archived: true
- Created: 2017-07-06T18:15:29.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-08-01T08:18:50.000Z (over 2 years ago)
- Last Synced: 2025-05-05T16:05:18.121Z (11 months ago)
- Topics: bundle, constraints, feature, feature-flags, feature-toggles, rollout, symfony, toggle
- Language: PHP
- Homepage:
- Size: 691 KB
- Stars: 212
- Watchers: 12
- Forks: 43
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Flagception
**Feature toggle bundle on steroids!** Flagception is a simple and powerful feature toggle system for php.
This bundle integrates the [Flagception PHP Libary](https://packagist.org/packages/flagception/flagception) for symfony 2.7 to 5.* (and php 5.6 to php7.*).
[](https://packagist.org/packages/flagception/flagception-bundle)
[](https://coveralls.io/github/bestit/flagception-bundle?branch=master)
[](https://travis-ci.org/bestit/flagception-bundle)
[](https://packagist.org/packages/flagception/flagception-bundle)
[](https://packagist.org/packages/flagception/flagception-bundle)
[](https://insight.sensiolabs.com/projects/4423478b-f6db-4f77-bb36-0782bcdf82c0)
| Bundle Version (Tag) | Support Symfony | Branch |
|----------------------|-----------------|--------|
| <=3 | 2.7 - 4.4 | 3.x |
| >=4 | 4.4 - current | master |
```console
$ composer require flagception/flagception-bundle
```
Documentation
---------------------------
* [Installation](docs/install.md)
* [Upgrade from 2.x](UPGRADE-3.0.md)
* [Upgrade from 3.x](UPGRADE-4.0.md)
* [Usage](docs/usage.md)
* [Twig flags](docs/twig.md)
* [Route flags](docs/route.md)
* [Annotation flags](docs/annotation.md)
* [Constraints](docs/constraint.md)
* [Environment variables](docs/environment.md)
* [Cookies](docs/cookie.md)
* [Database](docs/database.md)
* [Activators](docs/activator.md)
* [Profiler](docs/profiler.md)
Quick example
---------------------------
Set some feature in your config (or use your own [activator](docs/activator.md) for fetching features from wherever you want) ...
```yml
flagception:
# Your Features (optional you left it empty)
features:
# Feature name as key
feature_123:
# Default flag if inactive or active (default: false)
default: true
# Feature state from an environment variable
feature_abc:
env: FEATURE_ENV_ABC
# Feature with constraint (active if user id is 12 OR it is between 8 am and 6 pm)
feature_def:
constraint: 'user_id == 12 or (date("H") > 8 and date("H") < 18)'
# All togther (chain)
feature_def:
default: false
env: FEATURE_ENV_ABC
constraint: 'user_id == 12 or (date("H") > 8 and date("H") < 18)'
```
... and use it in controller, services or twig:
```twig
{% if feature('feature_123') %}
{# Execute if feature is active ... #}
{% endif %}
```
See [usage documentation](docs/usage.md) for detailed examples.
Profiler
---------------------------
This bundle ships a profiler tab, where you can see how often a feature was requested, which results it returns (active or inactive) and
the given context.

Credits
-------------------------
Profiler icon from https://github.com/ionic-team/ionicons