Skip to content

[IMPROVEMENT] DI: keep pimple/pimple inside the DI component - #12267

Merged
chfsx merged 3 commits into
ILIAS-eLearning:trunkfrom
srsolutionsag:improvement/12/di-pimple-wrapping
Oct 27, 2026
Merged

chfsx merged 3 commits into
ILIAS-eLearning:trunkfrom
srsolutionsag:improvement/12/di-pimple-wrapping

Conversation

@chfsx

@chfsx chfsx commented Oct 23, 2026

Copy link
Copy Markdown
Member

The local DICs of several components extended or instantiated Pimple\Container directly, and some code typed against it where the global $DIC is meant. This PR introduces ILIAS\DI\ServiceContainer as the one place that extends pimple, so the library can be updated or replaced in DI alone. Follow-up to #12266, which does the same for guzzlehttp/psr7 in HTTP.

DI

  • New ILIAS\DI\ServiceContainer extends \Pimple\Container, without API of its own. ILIAS\DI\Container (the global $DIC) now extends it.
  • Documented in the README of DI ("Local Containers").
  • ServiceContainer still is a Pimple\Container, so code outside of the core (e.g. plugins) typing against pimple keeps working.

Components

  • Local DICs extend or instantiate ServiceContainer instead of Pimple\Container: LearningSequence (ilLSDI, ilLSLocalDI), Test (TestDIC), TestQuestionPool (QuestionPoolDIC), ILIASObject and User (LocalDIC), WebDAV (ilWebDAVDIC), StudyProgramme (ilStudyProgrammeDIC), OrgUnit (ilOrgUnitLocalDIC), IndividualAssessment (ilIndividualAssessmentDIC) and the internal container of InitComponentService.
  • Types of local containers changed to ServiceContainer (ilPrgUpdateProgressCronJob, ilObjIndividualAssessment, tests of Test).
  • Types and instanceof checks that mean the global $DIC changed to ILIAS\DI\Container (Test\GUIFactory, ilStudyProgrammeMembershipSourceReaderFactory, AllModernComponents, ilRbacSystem, ilLoggingErrorSettings). The global $DIC is an ILIAS\DI\Container everywhere, also in all tests.
  • The bootstrap generator of Component (Renderer and its expected results) still creates Pimple\Container on purpose: the generated bootstrap must not depend on the legacy DI component. Once [IMPROVEMENT] HTTP: keep guzzlehttp/psr7 inside the HTTP component #12266 is merged, pimple/pimple will be added to the ilias.wrappedLibraryUsage code rule with DI and Component as its components.

Testing

  • Build: [OK] All static artifacts are build!, bootstrap artifacts for default and setup rebuilt.
  • PHPUnit, whole suite: green except RootFolderTest, which only fails locally because of untracked files in the root folder of my checkout.
  • Code rules gate on components/ILIAS: green. php-cs-fixer on the changed files: clean.
  • On a trunk installation, in the browser: test (test screen, settings, questions, participants, scoring), learning sequence (content, members), study programme (assignments, membership automation, settings), individual assessment (participants), organisational units (positions) and the personal profile. All tabs of these objects, of a question pool and the WebDAV administration also load without errors over HTTP.
  • The ilPrgUpdateProgressCronJob ends with STATUS_OK, and all entries of the local DICs of Test, TestQuestionPool, ILIASObject, User, StudyProgramme and OrgUnit resolve.

DI has no maintainer at the moment. @kergomard @dsstrassner for Test/TestQuestionPool, ILIASObject, User and AccessControl, @dkippKPG for LearningSequence, @maalers @mhomann-tf for StudyProgramme/OrgUnit, @mbecker-databay for IndividualAssessment, @smeyer-ilias for Logging, @mjansenDatabay @thibsy for Init/Component.

If there are no objections, I will merge this before Coding Completed.

@dsstrassner

Copy link
Copy Markdown
Contributor

@thojou please have also a Look for T&A!

@kergomard kergomard left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you very much @chfsx !

@mjansenDatabay mjansenDatabay added improvement php Pull requests that update Php code labels Oct 26, 2026

@mjansenDatabay mjansenDatabay left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks a lot!

@chfsx
chfsx merged commit 9cdae55 into ILIAS-eLearning:trunk Oct 27, 2026
5 checks passed
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.

4 participants