-
Improvement
-
Resolution: Unresolved
-
Critical
-
None
-
2.9
Composer has become very popular in the past few years, and it's easy to see why. It's made the act of installing and using libraries incredibly simple, and helped with standardising use of namespaces and autoloaders.
There have been proposals in the past to make Moodle itself available as a composer package, but I do not feel that this would be the right fit. Moodle is, after all, the application, it is not the library.
However, I feel that we should be able to use it as a way of installing third-party libraries which we use within Moodle. In order to help people use libraries in a standard way, we should also standardise how it is included.
So my proposal is that we:
- allow core use of the existing composer.json file in /composer.json with installation of packages to /vendor/
- should specify a fixed version of each library, and ensure correct generation of the composer.lock
- modify the Moodle autoloader to make use of the /vendor directory and include its vendor/autoload.php file
- only support use of Composer for core use and not in Plugins at this time.
This will allow us to move the management of many of the third-party libraries to composer.
Why
- Because its' a library world;
- We should be using the clients and libraries available to us;
- We shouldn't be managing their dependencies manually;
- We should make it easy for ourselves to upgrade libraries.
- blocks
-
MDL-55331 Put in place a proper OIDC Implementation
-
- Closed
-
-
MDL-48766 Support IPv6 in IP lookup tool
-
- Closed
-
- has a non-specific relationship to
-
MDL-38740 merge moodle/lib/thirdpartylibs.xml and other core dependencies into composer dependency management system
-
- Closed
-
- is duplicated by
-
MDL-60404 Use composer for managing 3-rd party libraries
-
- Closed
-
- will be (partly) resolved by
-
IDEA-75 Explore restructuring the Moodle codebase
-
- Ready for development
-
- will help resolve
-
MDL-59684 Allow plugins to specify PSR-4 namespaces
-
- Closed
-