pheature/inmemory-toggle
最新稳定版本:0.8.0
Composer 安装命令:
composer require pheature/inmemory-toggle
包简介
Pheature flags In Memory toggle implementation library.
README 文档
README
Installation
Install it using composer package manager.
composer require pheature/inmemory-toggle
Usage
Check https://github.com/pheature-flags/pheature-flags/tree/1.0.x/examples for more examples.
<?php declare(strict_types=1); use Pheature\Core\Toggle\Read\Toggle; use Pheature\InMemory\Toggle\InMemoryConfig; use Pheature\InMemory\Toggle\InMemoryFeatureFactory; use Pheature\InMemory\Toggle\InMemoryFeatureFinder; require '../vendor/autoload.php'; $config = [ 'toggles' => [ 'feature_1' => [ 'id' => 'feature_1', 'enabled' => false, 'strategies' => [] ], ] ]; $toggle = new Toggle(new InMemoryFeatureFinder( new InMemoryConfig($config['toggles']), new InMemoryFeatureFactory() )); if ($toggle->isEnabled('feature_1')) { echo 'The feature_1 is work in progress.' . PHP_EOL; } if (false === $toggle->isEnabled('feature_1')) { echo 'The old functionality to be changed when the feature_1 is ready.' . PHP_EOL; }
Contributing
Your contributions are always welcome! Please have a look at the contribution guidelines first.
License
We really believe in the Open Source Software, we built our carers around it, and we feel that we need to return our knowledge to the community. For this reason we release all our packages under BSD-3-Clause licence.
统计信息
- 总下载量: 83.91k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 4
- 推荐数: 3
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2021-04-11