开发者

Existing PHP Tool for Feature Toggle

开发者 https://www.devze.com 2023-03-30 12:48 出处:网络
Recently I\'ve read a number of articles talking about the idea of using \"feature toggles\" or \"gatekeepers\" to keep features hidden from users until the development is done. Facebook and Flickr bo

Recently I've read a number of articles talking about the idea of using "feature toggles" or "gatekeepers" to keep features hidden from users until the development is done. Facebook and Flickr both also talk about how they use this to test new features with a subset of users before 开发者_运维技巧unleashing them on everyone.

A bit of googling didn't turn up any existing PHP packages/tools that can be added to a web app to handle this type of thing. It seems straight forward enough to roll our own but no reason to re-invent that wheel if we don't need to. Are there any existing PHP tools to do this?

Articles

  • Feature Toggle by Martin Fowler
  • Flipping Out on Flickr DevBlog

Clarification: The part of this that I'm looking to see if it exists is the admin panel that controls which users can see the new features. In Flickr's example, they can turn it on based on the host. In the Facebook example, they add functionality such as limiting a feature to 5% of users, only TechCrunch users or only East coast users.

The admin panel seems crucial when you have 200 turned on features, 10 features that aren't quite done yet and 3 more that you're demoing for some users.


if (user_can_see_app()) {
    show_app();
} else {
    dont_show_app();
}

I fail to see why a package would be required for something so simple.


I've wrote a micro service for feature toggle pattern, called Bipolar:

https://marinho.github.io/bipolar-server

It is written in Python but that doesn't matter because it is an external API and Admin interface, so, all you need is to write a PHP client for it. We have used it in production for a while but only worked on public release and documentation recently. For JavaScript support it can push notifications using Webhooks as a basic URL call or via Pusher event.

I am bit missed after many years with no contact with PHP, but I can help you to write the client if you are interested.

I hope that can be helpful.


The easiest solution i found is to have the feature toggle state stored in some remote location that can change easily (turn it on/off)

I found it easy to have on GitHub a repo holding some JSON data with the feature toggle's state, later on you can change that state on GitHub (from phone/pc etc...)

your php code needs to fetch the JSON and make a decision from it ...

you can look at the blog post about how to achieve this:

http://www.nimrodstech.com/dead-simple-feature-toggle/

it shows a code snippet of how to achieve this in a simple way.

0

精彩评论

暂无评论...
验证码 换一张
取 消