承接 pheature/inmemory-toggle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

pheature/inmemory-toggle

最新稳定版本:0.8.0

Composer 安装命令:

composer require pheature/inmemory-toggle

包简介

Pheature flags In Memory toggle implementation library.

README 文档

README

Latest Version on Packagist Quality Score Type coverage Test Coverage Mutation testing badge Maintainability Total Downloads

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2021-04-11