jonathanbird/feature-switch 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

jonathanbird/feature-switch

Composer 安装命令:

composer require jonathanbird/feature-switch

包简介

Feature switching made easy

README 文档

README

Need to wrap new features for dev and production? Use a directive in the view or alias in the controller

There's great libraries in Java and other languages, but I found a real lack of good libraries to do this in PHP, so I've created my own.

Installation

Add the following line to the require section of composer.json:

{
    "require": {
        "jonathanbird/feature-switch": "dev-master"
    }
}

or composer require jonathanbird/feature-switch

Setup

  1. Add 'JonathanBird\FeatureSwitch\FeatureSwitchServiceProvider', to the service provider list in app/config/app.php.
  2. Run php artisan vendor:publish to publish the features config file to config/feature-switch/features.php

Usage

  1. In the view, you can use the directive @feature('feature_name') something @endfeature (note @else also works for when a feature is not enabled)
  2. In your controller or anywhere, simply add use Feature; to the top of your file and use the alias Feature::isEnabled('feature_one') which returns a boolean value
  3. To add features, add your feature name and boolean value to config/feature-switch/features.php

Why would I use this over git merging?

If you have multiple environments (e.g. three test environments, staging and production) and you want to have the code base in a state of continuous deployment, then you may wish to branch your feature, wrap it within feature switch, merge it in to master branch, and when it gets to staging or production and you realise there's a bug, you can simply switch the feature off without it causing an issue rather than having to remove code from a merge. This is also works well for launching a feature as it's a simple on/off switch - simply git ignore the features.php file to have a different one in each environment.

Issues

If you find an issue, please report it. If it's something you can fix, fork the project and use a pull request as it'll be much quicker.

jonathanbird/feature-switch 适用场景与选型建议

jonathanbird/feature-switch 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 34.57k 次下载、GitHub Stars 达 26, 最近一次更新时间为 2016 年 06 月 07 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 jonathanbird/feature-switch 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 jonathanbird/feature-switch 我们能提供哪些服务?
定制开发 / 二次开发

基于 jonathanbird/feature-switch 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 26
  • Watchers: 2
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-06-07