-
Improvement
-
Resolution: Fixed
-
Minor
-
2.8, 2.9
-
None
-
MOODLE_28_STABLE, MOODLE_29_STABLE
-
MOODLE_29_STABLE
-
The current state
At the moment the plugin environment check requires that you define a specific version of Moodle for the environment checks to be carried out in, i.e.
<COMPATIBILITY_MATRIX>
<MOODLE version="2.6">
<PHP_EXTENSIONS>
<PHP_EXTENSION name="xml" level="required" />
<PHP_EXTENSION name="xsl" level="required" />
</PHP_EXTENSIONS>
</MOODLE>
</COMPATIBILITY_MATRIX>
Even though a plugin would likely have the same environment requirements in any version of Moodle.
The proposal
This feature would be more usable for developers if it was possible to make the requirements work against all versions of Moodle.
The code I have developed does this by adding a new PLUGIN tag
<COMPATIBILITY_MATRIX>
<PLUGIN name="franken_style">
<PHP_EXTENSIONS>
<PHP_EXTENSION name="xml" level="required" />
<PHP_EXTENSION name="xsl" level="required" />
</PHP_EXTENSIONS>
</PLUGIN>
</COMPATIBILITY_MATRIX>
The tag has the following properties:
- The Environment file would not break versions of Moodle that do not support the PLUGIN syntax, as the PLUGIN tag would be ignored by them.
- Specific versioned MOODLE tags could be defined for 2.6, 2.7 and 2.8 if you wanted all versions of Moodle that support plugin environment.xml files to work.
- If both MOODLE and PLUGIN tags exist the PLUGIN tag will be used in preference.
- The PLUGIN tag will not function in the main Moodle environment.xml file.
- the PLUGIN tag has an optional attribute of name. If present the checks will only be run when it matches the plugins franken_style name.
For a discussion on this issue see: https://moodle.org/mod/forum/discuss.php?d=274831