This is necessary because PHP in Windows does not have any certificates and some *nix systems have outdated or missing ca bundles too.
The order is:
1/ dataroot/moodleorgca.crt always wins - needs to be added manually by admin
2/ php.ini setting "curl.cainfo" is next
3/ on Windows libdir/cacert.pem is used because it does not have any default cert bundles
4/ system default is the last - the previous value, ok for properly configured *nix systems
The patch implements the second mode of the mdeploy.php script. If
--install option is passed, the given package is downloaded, verified
and deployed to the requested location.
The input_manager now accepts colons (:) in TYPE_PATH options, but only
in cases where the colon is used as a part of Windows drive labels, as
in C:\apache.
There is no need to move the root folder of a plugin during the update
deployment. We just need to operate with its contents. So the web server
process can have the write access for the plugin folder only.
The additional parameter allows to use this method without actual
removing the root of the path. That is, it is now possible to remove
the content of a folder only.
The additional parameter allows to use this method without actual
removing the root of the source location. That is, it is now possible to
move the content of a folder only.
Also, a small refactoring happened here as we will need a variant of
this method that does not throw exception if the target already exists.
The caller of the mdeploy.php utility is expected to create a file in
the data directory. The name of such file and the passphrase in it are
then sent to mdeploy.php as a part of the request. The submitted and
stored values are then compared.
This is supposed to serve as a standalone script that accepts parameters
via CLI or HTTP. As no Moodle library can be reliably included, we have
to implement our own input handling, output handling and processing the
actual update/install task.
PHPUnit is used to test the functionality. Although (again), the testing
must not be included as a part of standard Moodle PHPUnit environment
but explicitly.