Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

User:David Mudrak/Draft: Plugin impediments

From MoodleDocs
Declaration of plugin's installation impediments
Project state Spec draft
Tracker issue TODO
Discussion https://moodle.org/mod/forum/discuss.php?d=324520
Assignee David Mudrak


This is a draft proposal to extend the Moodle plugin's version.php meta-data with $plugin->impediments array.

Use cases

  • A plugin is not compatible with certain Moodle version (and higher).
  • A plugin somehow collides with another plugin (e.g. its fork) so that both can't be installed together in one Moodle.
  • A plugin depends on another plugin but it does not work with recent version of it and needs an older one.

Proposal

To declare that this plugin version requires Moodle 2.6 but it can't be installed into Moodle 3.0:

// version.php
$plugin->requires = 2013111800;
$plugin->impediments = array(
    'moodle' => 2015111600,  // Both 'moodle' and 'core' would have the same meaning here.
);

To declare that this plugin can't be installed together with the foobar module:

// version.php
$plugin->impediments = array(
    'mod_foobar' => ANY_VERSION,
);

To declare that this plugin requires mod_barbar version at least 2015010100 but not higher (or equal) to 2015120900:

// version.php
$plugin->dependencies = array(
    'mod_barbar' => 2015010100,
);
$plugin->impediments = array(
    'mod_barbar' => 2015120900,
);