Moved scheduled tasks classes to Scheduler component #6981
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have moved classes related to "scheduled tasks" into a new component name Scheduler.
For now I haven't touched at the logic itself, I have just renamed and moved classes from static classes to non-static classes using (a bit) dependency injection.
If you want to review the PR, I recommend you read commit-by-commit rather than the whole diff, I've tried to make them small and easy to follow.
My plan would be to extract this component from Piwik later on. Scheduling tasks is definitely a generic thing, and I had a look but no really good alternative exist. In the past I've used Quartz in Java, I'm sure there's a need for something in PHP. There is cron-expression that is a lib to parse Cron strings (but it doesn't do anything else), so our Scheduler could use that.