Giter Site home page Giter Site logo

flagception-bundle's Introduction

Flagception

Feature toggle bundle on steroids! Flagception is a simple and powerful feature toggle system for php. This bundle integrates the Flagception PHP Libary for symfony 2.7 to 5.* (and php 5.6 to php7.*).

Latest Stable Version Coverage Status Build Status Total Downloads License

SensioLabsInsight

Bundle Version (Tag) Support Symfony Branch
<=3 2.7 - 4.4 3.x
>=4 5.0 - current master
$ composer require flagception/flagception-bundle

Documentation

Quick example

Set some feature in your config (or use your own activator for fetching features from wherever you want) ...

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:

{% if feature('feature_123') %}
    {# Execute if feature is active ... #}
{% endif %}

See usage documentation 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.

Image of Profiler

Credits

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

flagception-bundle's People

Contributors

migo315 avatar haehnchen avatar redactedprofile avatar 0x346e3730 avatar chq81 avatar hanish-singla avatar teiling88 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.