Skip to content

Instantly share code, notes, and snippets.

@gbirke
Last active June 11, 2018 08:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gbirke/ab53316c69341718a9dd5cb79ed32642 to your computer and use it in GitHub Desktop.
Save gbirke/ab53316c69341718a9dd5cb79ed32642 to your computer and use it in GitHub Desktop.
Overview of PHP feature toggle libraries

Overview of PHP feature toggle libraries

Ordered by personal preference, while thinking about using them for https://github.com/wmde/FundraisingFrontend

Pro:

  • Common checks based on user/environment/date are already defined.
  • Provides logging/audit
  • Allows caching of feature sets so feature config does not need to be read on every request
  • Uses PHP 7
  • 100% test coverage

Pro:

  • Good code quality + 100% test coverage
  • Decision logic for on/off is very extensible, we can write our own

Con:

  • Caching not implemented yet

Pro:

  • Uses callable strategies for deciding if a feature is active
  • Can have multiple strategies for feature, not only on/off
  • Callables can be integrated well into the factory

Con:

  • Only 10 different "buckets". Might be enough for us, but still makes the configuration harder, since on/off toggled can'T be made independently from each other.

Pro:

  • Decision logic for on/off is very extensible, we can write our own

Con:

  • Configuration of self-made toggle criteria relies on symfony/options-resolver, which complicates configuration unnceccessarily.

Pro:

  • Active development & wide usage
  • Easy to understand

Con:

  • Provides database storage (which we don't need)
  • Group feature does not match our use case

Con:

  • Weird array configuration language
  • Static functions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment