Closed golenkovm closed 2 years ago
Cross post:
CLI scripts either don't have a concept of a user, or they run effectively like sudo as the primary admin user.
If you are manually running a cli script and you want to force the condition of any arbitrary experiment then a better way of passing this in in a very generic way which enabled you to specify which experiment on the cli is using an environment var:
EXPERIMENT_SHORTNAME=conditionset php admin/cli/mycli.php --foo=bar
So this is exactly equivalent to doing ?experimentshortname=conditionset in a web request
Pretty well exactly like how this does it https://tracker.moodle.org/browse/MDL-67081
Closing this as Won't fix
@golenkovm what is wrong with the env vars approach?
EXPERIMENT_SHORTNAME=conditionset php admin/cli/mycli.php --foo=bar
The very first use case is to run cron with bumped debugging but there might be more other use cases when you'd need to run scripts with tweaked config.