MDL-72720 plugininfo: Add enable_plugin() method to base class

This commit is contained in:
Sara Arjona 2021-10-01 10:52:13 +02:00
parent 9145d80b0b
commit cf54e29ddc
2 changed files with 17 additions and 0 deletions

View File

@ -79,6 +79,20 @@ abstract class base {
return null;
}
/**
* Enable or disable a plugin.
* When possible, the change will be stored into the config_log table, to let admins check when/who has modified it.
*
* @param string $pluginname The plugin name to enable/disable.
* @param int $enabled Whether the pluginname should be enabled (1) or not (0). This is an integer because some plugins, such
* as filters or repositories, might support more statuses than just enabled/disabled.
*
* @return bool Whether $pluginname has been updated or not.
*/
public static function enable_plugin(string $pluginname, int $enabled): bool {
return false;
}
/**
* Gathers and returns the information about all plugins of the given type,
* either on disk or previously installed.

View File

@ -106,6 +106,9 @@ completely removed from Moodle core too.
* Require pass grade criteria is now part of core.
Refer to upgrade.php to see transitioning from similar plugin criteria to core
Refer to completion/upgrade.txt for additional information.
* The method enable_plugin() has been added to the core_plugininfo\base class and it has been implemented by all the plugininfo
classes extending it. When possible, the enable_plugin() method will store these changes into the config_log table, to let admins
check when and who has enabled/disabled plugins.
=== 3.11.2 ===
* For security reasons, filelib has been updated so all requests now use emulated redirects.