
Feature Switching in PHP - jonobird1
https://github.com/jonathan-bird/feature-switch
======
smt88
The proper way to do this is with branches, not with hard-coded logic

~~~
jonobird1
That's one option.

However the issue with that is if you have multiple environments (e.g. three
test environments, staging and production) and you want to have the code in a
state of continuous deployment, then you use your branch for your feature,
merge it in with this feature switch and when it gets to staging 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.

~~~
smt88
You shouldn't merge until you've tested and are fairly certain there isn't a
bug. Bugs in staging shouldn't be common and fixes should be fairly quick and
easy. That's what staging is for, after all.

~~~
jonobird1
I work in a code base that's 5 million lines of code. It happens.

That aside, it's very useful for launching features. I have used this practice
at Expedia and works well.

