MDL-76052 webservice_xmlrpc: Remove it completely from core

Normal removal procedure:
  - Remove the plugin completely from core.
  - Document it in the webservices upgrade.txt file.
  - Add a core upgrade step to proceed to remove any configuration
    if the plugin has not been re-installed manually.

Plus:
  - Remove a few remaining uses in the hub/sites registration scripts,
    that were moved from xmlrpc to hand.made rest calls by MDL-31436
    (Moodle 3.4.1 and up) and never removed then.
  - Remove the php-xmlrpc extension as a recommendation in composer.
  - Remove "xmlrpc" from various comments, trivial cleanup.

Note:
  - While working on this MDL-76078 has been created about to
    fix a serious design problem detected (it does not affect
    functionality). That's out from this issue scope.
This commit is contained in:
Eloy Lafuente (stronk7) 2022-10-21 19:30:07 +02:00
parent fee1b8ce5f
commit df227f3819
22 changed files with 38 additions and 1171 deletions

View file

@ -25,7 +25,6 @@
namespace core\hub;
defined('MOODLE_INTERNAL') || die();
use webservice_xmlrpc_client;
use moodle_exception;
use curl;
use stdClass;
@ -370,4 +369,4 @@ class api {
public static function upload_course_backup($hubcourseid, \stored_file $backupfile) {
debugging("This function has been deprecated as part of the Moodle.net sunsetting process.");
}
}
}

View file

@ -1745,7 +1745,7 @@ class core_plugin_manager {
'binarius', 'boxxie', 'brick', 'canvas', 'formal_white', 'formfactor', 'fusion', 'leatherbound',
'magazine', 'mymobile', 'nimble', 'nonzero', 'overlay', 'serenity', 'sky_high', 'splash',
'standard', 'standardold'),
'webservice' => array('amf'),
'webservice' => array('amf', 'xmlrpc'),
);
if (!isset($plugins[$type])) {
@ -2047,7 +2047,7 @@ class core_plugin_manager {
),
'webservice' => array(
'rest', 'soap', 'xmlrpc'
'rest', 'soap'
),
'workshopallocation' => array(

View file

@ -116,10 +116,6 @@ class webservice extends base {
}
public function is_uninstall_allowed() {
// The xmlrpc plugin contains webservice_xmlrpc_client (used by core).
if ($this->name == 'xmlrpc') {
return false;
}
return true;
}
}

View file

@ -3005,5 +3005,31 @@ privatefiles,moodle|/user/files.php';
upgrade_main_savepoint(true, 2022102800.01);
}
if ($oldversion < 2022110600.00) {
// If webservice_xmlrpc isn't any longer installed, remove its configuration,
// capabilities and presence in other settings.
if (!file_exists($CFG->dirroot . '/webservice/xmlrpc/version.php')) {
// No DB structures to delete in this plugin.
// Remove capabilities.
capabilities_cleanup('webservice_xmlrpc');
// Remove own configuration.
unset_all_config_for_plugin('webservice_xmlrpc');
// Remove it from the enabled protocols if it was there.
$protos = get_config('core', 'webserviceprotocols');
$protoarr = explode(',', $protos);
$protoarr = array_filter($protoarr, function($ele) {
return trim($ele) !== 'xmlrpc';
});
$protos = implode(',', $protoarr);
set_config('webserviceprotocols', $protos);
}
// Main savepoint reached.
upgrade_main_savepoint(true, 2022110600.00);
}
return true;
}