coduo / flipper
Installs: 1 599
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 2
Open Issues: 1
Requires
- php: >=5.3.0
Requires (Dev)
- behat/behat: 3.0.*
- bossa/phpspec2-expect: dev-master
- coduo/phpspec-prepare-extension: dev-master
- phpspec/phpspec: 2.0.*
This package is not auto-updated.
Last update: 2020-03-02 04:16:30 UTC
README
WIP Simple and extensive feature flipper for php. Identifier centric.
Create a context and register your arguments in context
<?php use Coduo\Flipper; use Coduo\Flipper\Feature\Repository\InMemoryFeatureRepository; use Coduo\Flipper\Activation\Strategy; $context = new Flipper\Activation\Context('default'); $context2 = new Flipper\Activation\Context('some_dummy_context'); $context->registerArgument(new Flipper\Activation\Argument\UserIdentifier('michal@coduo.pl'); ```php ## Set up your feature definitions $flipper = new Flipper(new InMemoryFeatureRepository()); $flipper->addContext($this->context); $feature = new Feature('captcha', new Strategy\UserIdentifier( new Flipper\Activation\Argument\UserIdentifier('michal@coduo.pl') ])); $feature2 = new Feature('new_topbar', new Strategy\SystemWide(true)); $flipper->add($feature); $flipper->add($feature2);
Check it
<?php $flipper->isActive('captcha', 'default'); #true $flipper->isActive('captcha', 'Argument'); #false
require: {
"coduo/flipper": "dev-master"
}