I want to disable contexts programmatically (for automated updates, where a new release of a website needs a context to be disabled).
I manage contexts using Features, but Features doesn't hold the enabled/disabled status of the context.
I can't find a function to change context status programmatically. There's a support request but the snippet is not working (nothing happens, context remains the same status).
After some investigation I came across the context_status variable. It seems to hold an array with context names as key and TRUE as value: each of these contexts is disabled. If you edit that variable by unsetting one context, the context becomes enabled.
So it seems the only way to disable/enable a context programmatically is to edit this conext_status.
Is there a better way to do it?