lwiesel / feature-checker-bundle
Enable and disable functional features in Symfony2 applications.
Installs: 224
Dependents: 0
Suggesters: 0
Security: 0
Stars: 13
Watchers: 6
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.3.2
- doctrine/common: ~2.4
- lwiesel/feature-checker: ~1.1
- symfony/framework-bundle: ~2.3
- symfony/twig-bundle: ~2.3
Requires (Dev)
- henrikbjorn/phpspec-code-coverage: ~1.0
- phpspec/phpspec: ~2.1
- phpunit/phpunit: 4.*
- scrutinizer/ocular: ~1.1
This package is not auto-updated.
Last update: 2024-12-21 17:48:37 UTC
README
Define features, and check if they are activated or not in your Symfony2 application.
Usage
Define a feature configuration in your config.yml
.
# app/config/config.yml feature_checker: features: feature1: true feature2: false feature3: feature31: true feature32: true
Then use the features names in controller annotations. Only the allowed features will execute the action.
<?php // src/AppBundle/Controller/DefaultController.php namespace AppBundle\Controller; use LWI\FeatureCheckerBundle\Annotations\MustHaveFeature; use Symfony\Bundle\FrameworkBundle\Controller\Controller; class DefaultController extends Controller { /** * @MustHaveFeature("feature1") */ public function indexAction() { return $this->render('default/index.html.twig'); } }
Sub-features can be checked with this notation:
/** * @MustHaveFeature("feature1") * @MustHaveFeature("feature3.feature31") */ public function secondAction() { return $this->render('default/second.html.twig'); }
You can also test whole feature sets. A feature set is considered enabled when all sub-features -at any sub-level- is enabled.
/** * @MustHaveFeature("feature3") */ public function thirdAction() { return $this->render('default/third.html.twig'); } }
Installation
Please see Full documentation for details.
Testing
$ bin/phpspec run
Contributing
Please see CONTRIBUTING for details.
Changelog
Please see CHANGELOG for details.
Security
If you discover any security related issues, please email wiesel.laurent@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.