`DOING_CRON` isn't defined #28

Open
dd32 opened this Issue Nov 21, 2016 · 3 comments

Projects

None yet

2 participants

@dd32
Contributor
dd32 commented Nov 21, 2016

I just noticed that DOING_CRON isn't defined when running jobs, this could cause unexpected behaviour for some jobs.

While running through WP-CLI, it won't be possible to define it before bootstrap occurs (AFAIK), but defining it late might be better than not at all.

@rmccue
Member
rmccue commented Jan 10, 2017

We should do this as soon as possible, but I think that's likely to be when the command's callback fires. We can't really hook in any earlier.

@dd32
Contributor
dd32 commented Jan 10, 2017

Perhaps an option would be to enhance WP-CLI to accept certain constants on the command line? ie. wp --debug=true --cron=on

@rmccue
Member
rmccue commented Jan 10, 2017

wp-cli itself only sets the constant late, so I'm fine with also setting it late.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment