From f77afec9eab8b6e43629edf8ea353238ba20e327 Mon Sep 17 00:00:00 2001 From: Fabian Schmid Date: Fri, 17 Jul 2026 10:29:31 +0200 Subject: [PATCH] [REFACTOR] Move master.ini templates and their reader to Init component The ilias.master.ini.php / client.master.ini.php templates and their sole consumer ilIniFilesPopulatedObjective lived in the Setup component (formerly setup_). They seed the ilias.ini.php / client.ini.php written during installation - an Init/environment concern - so both the templates and the objective belong in the Init component. Moved: - components/ILIAS/Setup/{ilias,client}.master.ini.php -> components/ILIAS/Init/resources/ - components/ILIAS/Setup/classes/class.ilIniFilesPopulatedObjective.php -> components/ILIAS/Init/classes/ The objective now reads its templates same-component via dirname(__DIR__) . '/resources/...'. All other __DIR__ based paths keep working because Init/classes has the same nesting depth as Setup/classes. The class stays in the global namespace, so its many callers across components resolve unchanged via the classmap. composer.json classmap excludes updated to the new template locations. --- .../classes/class.ilIniFilesPopulatedObjective.php | 4 ++-- .../ILIAS/{Setup => Init/resources}/client.master.ini.php | 0 .../ILIAS/{Setup => Init/resources}/ilias.master.ini.php | 0 composer.json | 4 ++-- 4 files changed, 4 insertions(+), 4 deletions(-) rename components/ILIAS/{Setup => Init}/classes/class.ilIniFilesPopulatedObjective.php (94%) rename components/ILIAS/{Setup => Init/resources}/client.master.ini.php (100%) rename components/ILIAS/{Setup => Init/resources}/ilias.master.ini.php (100%) diff --git a/components/ILIAS/Setup/classes/class.ilIniFilesPopulatedObjective.php b/components/ILIAS/Init/classes/class.ilIniFilesPopulatedObjective.php similarity index 94% rename from components/ILIAS/Setup/classes/class.ilIniFilesPopulatedObjective.php rename to components/ILIAS/Init/classes/class.ilIniFilesPopulatedObjective.php index 75d3cc184ca7..877696fb0668 100755 --- a/components/ILIAS/Setup/classes/class.ilIniFilesPopulatedObjective.php +++ b/components/ILIAS/Init/classes/class.ilIniFilesPopulatedObjective.php @@ -65,7 +65,7 @@ public function achieve(Setup\Environment $environment): Setup\Environment $path = $this->getILIASIniPath(); if (!file_exists($path)) { $ini = new ilIniFile($path); - $ini->GROUPS = parse_ini_file(__DIR__ . "/../ilias.master.ini.php", true); + $ini->GROUPS = parse_ini_file(dirname(__DIR__) . "/resources/ilias.master.ini.php", true); $ini->write(); $environment = $environment ->withResource(Setup\Environment::RESOURCE_ILIAS_INI, $ini); @@ -74,7 +74,7 @@ public function achieve(Setup\Environment $environment): Setup\Environment $path = $this->getClientIniPath($client_id); if (!file_exists($path)) { $client_ini = new ilIniFile($path); - $client_ini->GROUPS = parse_ini_file(__DIR__ . "/../client.master.ini.php", true); + $client_ini->GROUPS = parse_ini_file(dirname(__DIR__) . "/resources/client.master.ini.php", true); $client_ini->write(); $environment = $environment ->withResource(Setup\Environment::RESOURCE_CLIENT_INI, $client_ini); diff --git a/components/ILIAS/Setup/client.master.ini.php b/components/ILIAS/Init/resources/client.master.ini.php similarity index 100% rename from components/ILIAS/Setup/client.master.ini.php rename to components/ILIAS/Init/resources/client.master.ini.php diff --git a/components/ILIAS/Setup/ilias.master.ini.php b/components/ILIAS/Init/resources/ilias.master.ini.php similarity index 100% rename from components/ILIAS/Setup/ilias.master.ini.php rename to components/ILIAS/Init/resources/ilias.master.ini.php diff --git a/composer.json b/composer.json index e6356cde6bf7..147736fa56c4 100755 --- a/composer.json +++ b/composer.json @@ -98,8 +98,8 @@ "./public/Customizing/**/vendor", "./components/ILIAS/Setup/sql", "./cli/setup.php", - "./components/ILIAS/Setup/client.master.ini.php", - "./components/ILIAS/Setup/ilias.master.ini.php" + "./components/ILIAS/Init/resources/client.master.ini.php", + "./components/ILIAS/Init/resources/ilias.master.ini.php" ] }, "extra": {