Feature Wiki
Tabs
Include Plugins into composer autoloader
Page Overview
[Hide]1 Initial Problem
During the course of the last releases, we included composer and the classmap of composer into the system. Currently this does not expand to plugins. This situation becomes cumbersome and hard to maintain for various reasons:
- developers need to be aware that source code for classes needs to be explicitly included in plugins but not in the core anymore
- plugins are not included when static artifacts are build
- plugins need special cases in various sub systems, such as ilCtrl and the setup
2 Conceptual Summary
Plugins are included in the classmap of composer just like other modules. This will require an additional composer install
to regenerate the classmap after a plugin has been included in the source code of an installation. This, however, seems to be a workable tradeoff, since admins will need to deal with composer on a more frequent base anyway since dependencies where removed from the repo.
Please note that we might want to go further regarding plugins and composer, but this is not implied by this request:
- This won't introduce anything new regarding namespaces in plugins.
- This will not take care of dependencies of plugins and somehow include them.
- This will not care about any other composer facilities in the plugins.
3 User Interface Modifications
Since this is a technical change, no user interfaces are affected.
4 Technical Information
- This change is only about including the plugin directory when scanning the codebase to create the autoloader classmap.
- This does not intend to include the dependencies of plugins, possibly included in their own composer.json, into the process to
composer install
ILIAS. - PR is here: https://github.com/ILIAS-eLearning/ILIAS/pull/2758
5 Privacy Information
No personal information will be stored when this feature is implemented.
6 Security Implications
No security implications are expected if this change is implemented.
7 Contact
- Author of the Request: Klees, Richard [rklees]
- Maintainer: Klees, Richard [rklees], Studer, Martin [mstuder]
- Implementation of the feature is done by: CaT ILIAS Team
8 Funding
If you are interest in funding this feature, please add your name and institution to this list.
9 Discussion
JourFixe, ILIAS [jourfixe], 08 JUN 2020 : We highly appreciate this suggestion and accept the changes for ILIAS 7. Please extend the 'plugin how-to' accordingly to notify plugin developers about the problem of same class names and same used libraries and how to prevent them. If the web-based setup is implemented, please add an action for composer update to it.
10 Implementation
This is implemented as described in PR 2758. The plugins vendor directories are not included into the classmap, as implemented in PR 2929.
Test Cases
Test cases completed at {date} by {user}
- C42480 : Plugins sind Teil der Composer Classmap
Approval
Approved at 2020-11-09 by Klees, Richard [rklees].
Last edited: 16. Nov 2020, 15:04, Klees, Richard [rklees]