7

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

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.

Ian Ringrose
  • 51,220
  • 55
  • 213
  • 317
  • very simple to roll your own i do it all the time, check user not me, don't load the menu item. check user not me redirect to front page from sections front end controller –  Aug 22 '11 at 21:48
  • Which Framework are you using? Which Webserver? Which Proxy? – hakre Aug 22 '11 at 22:01
  • Feature toggles are simply an "if" statement in your code. There is a good post that explains [Feature Toggle](http://www.aviransplace.com/2013/03/27/continuous-delivery-part-3-feature-toggles), and also an idea to make it a little more than just an if using a feature toggle manager so you can also tests it and manage the feature toggles –  Mar 31 '13 at 06:09
  • This question needs a bit more attraction – Django Anonymous Jul 01 '14 at 06:18

3 Answers3

1

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.

Marinho Brandão
  • 637
  • 1
  • 9
  • 30
1
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.

Marc B
  • 356,200
  • 43
  • 426
  • 500
  • Updated the question. I'm interested to see if there's an existing admin panel to handle the answer from user_can_see_app(). – Jonathan Campbell Aug 22 '11 at 21:57
  • 2
    The condition isn't the main part. The most important of having a package for feature switching is being able to load the states, cache them locally and validate the same feature in more than one place. Also having an Admin tool and ways to integrate with other languages, components and frontend are also welcome. – Marinho Brandão Jun 06 '14 at 07:55
0

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.

Nimrod007
  • 9,825
  • 8
  • 48
  • 71