lwiesel/feature-checker
最新稳定版本:v1.1.2
Composer 安装命令:
composer require lwiesel/feature-checker
包简介
Enable and disable functional features in php application.
README 文档
README
Define features, and check if they are activated or not in your php application. Integrates well with Symfony2 bundle lwiesel/FeatureCheckerBundle.
Install
Via Composer
$ composer require lwiesel/feature-checker
Usage
$features = array( 'feature-A' => true, 'feature-B' => false, 'feature-set-C' => array( 'feature-C1' => true, 'feature-C2' => true, ), 'feature-set-D' => array( 'feature-D1' => true, 'feature-set-D2' => array( 'feature-D2-a' => true, 'feature-D2-b' => false, ), ), ); $checker = new LWI\FeatureChecker($features); // ... if ($checker->isFeatureEnabled('feature-A')) { // Do something here }
Sub-features can be checked with this notation:
$checker->isFeatureEnabled('feature-set-C.feature-C1');// returns true
You can also test whole feature sets. A feature set is considered enabled when all sub-features -at any sub-level- is enabled.
$checker->isFeatureEnabled('feature-set-C');// returns true $checker->isFeatureEnabled('feature-set-D');// returns false
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.
统计信息
- 总下载量: 374
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-02-23