flagception-bundle icon indicating copy to clipboard operation
flagception-bundle copied to clipboard

[Add] Memory activator

Open migo315 opened this issue 7 years ago • 1 comments

For some it is confusing that some activators (eg cookie, environment) share the "features" tree while others (eg database, contentful) are independent of it.

Therefore, it makes sense to pack the activators that share the same config together. Example:

# config.yml

flagception:   
    features: // moved under "memory"

    activators:    
        memory:
            enable: true
            strategy: all
            features:
                feature_foobar:
                    roles: USER_ROLE
                    cookie: true
                    strategy: all
                feature_bazz:
                    default: true
        database:
            // ...
        contentful:
            // ...
        prismic:
            // ...

The new MemoryActivator is an additional activator to prevent a BC. But in the long term, it should replace the old ArrayActivator, EnvironmentActivator, ConstraintActivator, and CookieActivator.

migo315 avatar Sep 28 '18 21:09 migo315

The new Flagception Bundle 4.0 will work without the shared "features" tree. Each activator has his own feature tree (if needed) or work without them.

The new "MemoryActivator" will replace the old ArrayActivator and ConstraintActivator. You can define a boolean value or a constraint string (expression language).

# config.yml

flagception:   
    activators:    
        memory:
            enable: true
            features:
                feature_foobar: true
                feature_bazz: 'date("H") > 8 and date("H") < 18'
        database:
            // ...
        contentful:
            // ...
        cookie:
            // ...

migo315 avatar May 06 '19 19:05 migo315