Skip to content

[FEATURE] Cron: Use "Component" mechanisms to gather and register jobs#11392

Open
mjansenDatabay wants to merge 1 commit intoILIAS-eLearning:trunkfrom
mjansenDatabay:feature/12/cron-component-revision
Open

[FEATURE] Cron: Use "Component" mechanisms to gather and register jobs#11392
mjansenDatabay wants to merge 1 commit intoILIAS-eLearning:trunkfrom
mjansenDatabay:feature/12/cron-component-revision

Conversation

@mjansenDatabay
Copy link
Copy Markdown
Contributor

@mjansenDatabay mjansenDatabay commented Apr 2, 2026

This pull request continues the initiative started by @nhaagen in pull request #8731 to gather and register cron jobs based on the mechanisms of the "Component Revision".

With this PR, following the deprecation announcement in ILIAS 11 (#11395), cron job implementations will (there are exceptions) no longer have a __construct. Dependencies are initialized in an init method, where class members can be populated by pulling services from the $DIC. init will then be called whenever the cron component decides that it needs fully initialized cron jobs. This procedure will be necessary as long as our code base is not fully migrated to the "Component" mechanisms.

Instead of individual reviews for each modification in the components contributing cron jobs, the changes will be announced at the next JF meeting. This provides all "Authorities to Sign off on Code Changes" with a designated period, spanning "several weeks", to submit comments, remarks, or change requests. This approach accommodates the expectation that formal approval from every authority may not be feasible.


What this PR also does / Breaking Changes:

  • It removes the \ILIAS\Cron\Job\JobProvider public interface, which helped ILIAS plugins (of any kind) to contribute cron jobs.
  • It removes the \ILIAS\Cron\CronHookPlugin plugin slot

@mjansenDatabay mjansenDatabay self-assigned this Apr 2, 2026
@mjansenDatabay mjansenDatabay added improvement php Pull requests that update Php code labels Apr 2, 2026
@mjansenDatabay mjansenDatabay force-pushed the feature/12/cron-component-revision branch 2 times, most recently from 260b8ce to 3301862 Compare April 2, 2026 13:11
@mjansenDatabay mjansenDatabay changed the title [FEATURE]: Use "Component" mechanisms to gather and register jobs [FEATURE] Cron: Use "Component" mechanisms to gather and register jobs Apr 2, 2026
@mjansenDatabay mjansenDatabay force-pushed the feature/12/cron-component-revision branch 2 times, most recently from 2279cef to 0d8bf94 Compare April 2, 2026 17:58
@mjansenDatabay
Copy link
Copy Markdown
Contributor Author

@smeyer-ilias

  • I had to introduce a minimal PHP interface for a "Logger Factory" in components/ILIAS/Logging/src/LoggerFactory.php. This is required to instantiate cron jobs in the build process (in the <Component>.php file) and passing a mock logger factory to the constructor.
  • Furthermore, I had to $define this interface and also put it to the $internal container (as well as a mock "Logging Setting" instance) in the Logging.php component file to make them work.

The mocks are necessary as long as the "Logging" component is not fully migrated to the "Component Revision End Game".

@matthiaskunkel
Copy link
Copy Markdown
Member

matthiaskunkel commented Apr 13, 2026

Jour Fixe, 13 APR 2026: We highly appreciate this suggestion and accept the PR for trunk / ILIAS 12. Nevertheless, we need to address the language handling problem of plugins / external components to load their language variables in the future. We should have a common workshop on this topic in the very near future.
We ask all maintainers to have a look at this PR and give feedback or ask Michael in case of questions. Michael plans to merge the PR in the next six weeks.

Copy link
Copy Markdown
Contributor

@kergomard kergomard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for this improvement!

I would have a small request: Could you please stick to using array-access to the $DIC in User?

Other than this I really like the change and changes in Test and User are perfectly fine.

Thank you very much and best,
@kergomard

Co-authored-by: Nils Haagen <nhaagen@concepts-and-training.de>
@mjansenDatabay mjansenDatabay force-pushed the feature/12/cron-component-revision branch from 0d8bf94 to 8705ed2 Compare April 14, 2026 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants