承接 davispeixoto/featuretoggle 相关项目开发

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

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

davispeixoto/featuretoggle

最新稳定版本:1.0.4

Composer 安装命令:

composer require davispeixoto/featuretoggle

包简介

A PHP Feature Toggle library

README 文档

README

This package provides a simple feature toggle mechanism for PHP applications.

Latest Stable Version Total Downloads Scrutinizer Code Quality Code Coverage Build Status SensioLabsInsight

Installation

The package can be installed via Composer by requiring the davispeixoto/featuretoggle package in your project's composer.json.

{
    "require": {
        "davispeixoto/featuretoggle": "~1.0"
    }
}

And running a composer update from your terminal:

php composer.phar update

Configuration

Just put your features into the config file, with their respective state (true or false):

return [
    'my_feature' => true,
    'my_other_feature' => [
        'pt_br' => true,
        'en_us' => true,
        'es_es' => false
    ],
    ...
];

Usage

That's it! You're all set to go. Just use:

    Davispeixoto\FeatureToggler\FeatureToggler;
    ...

    $toggler = new FeatureToggler('path/to/my_config_file.php');

    if($toggler->isEnabled('my_feature')) {
        // do the feature here
    }

    ...
    // for multidimensional config array
    if($toggler->isEnabled('my_other_feature.en_us')) {
        // new code here
    } else {
        // old code here
    }

License

This software is licensed under the MIT license

Versioning

This project follows the Semantic Versioning

Thanks

An amazing "Thank you, guys!" for Jetbrains folks, who kindly empower this project with a free open-source license for PhpStorm which can bring a whole new level of joy for coding.

Jetbrains

PhpStorm

统计信息

  • 总下载量: 17.81k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-08-17