Skip to content

Commit

Permalink
MDL-72720 plugininfo: Add enable_plugin() method to base class
Browse files Browse the repository at this point in the history
  • Loading branch information
sarjona committed Oct 14, 2021
1 parent 9145d80 commit cf54e29
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/classes/plugininfo/base.php
Expand Up @@ -79,6 +79,20 @@ public static function get_enabled_plugins() {
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.
Expand Down
3 changes: 3 additions & 0 deletions lib/upgrade.txt
Expand Up @@ -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.
Expand Down

0 comments on commit cf54e29

Please sign in to comment.