PostHog / posthog-php

MIT License
18 stars 19 forks source link

Add feature flags #18

Closed yakkomajuri closed 3 years ago

yakkomajuri commented 3 years ago

This supersedes #12 because @imhmdb is recovering from surgery (get better!) so I took over the PR and it doesn't allow edits by maintainers.

@imhmdb you will still get a gift card from us for this contribution.

@posthog-bot please add @imhmdb for code.

This simplifies the entire approach in #12. I sent @imhmdb in circles by sharing our feature flags spec without realizing PHP can't really do concurrent/parallel processing, making it so that we can't have the poller and leverage is_simple_flag. Therefore, this is a pretty simple implementation that just calls decide synchronously and checks the result that way each time.

yakkomajuri commented 3 years ago

@mariusandra could you give this a quick look? I just removed some code from #12 and it works but I have no idea what I'm doing when it comes to PHP.

Also, some extension I installed keeps showing these (also in master):

Screenshot 2021-06-22 at 12 28 55

Not sure what to do about it. The lib seems to work fine. I suspect some of these methods are implemented in some consumers but not others and we don't do the proper checking?