General developer forum

environment.xml for plugin ignored

 
Picture of Steffen Hippeli
environment.xml for plugin ignored
Plugin developers

Hello,

i want to check some php extentions on installation of my plugin and therefore i put a file environment.xml to the root directory of my plugin. The content is

<?xml version="1.0" encoding="UTF-8" ?>
    <PLUGIN name="mod_edusharing">
<PHP_EXTENSIONS>
<PHP_EXTENSION name="soap" level="required"/>
<PHP_EXTENSION name="curl" level="required"/>
</PHP_EXTENSIONS>
</PLUGIN>

In my code i extend the PHP Soap class. Without soap enabled a fatal error is thrown and this is what happens when i install the plugin.

I tested with moodle 3.4

What could be a reason for this behaviour?

 
Average of ratings: -
Picture of Matteo Scaramuccia
Re: environment.xml for plugin ignored
Core developersParticularly helpful MoodlersPlugin developers

Hi Steffen,
did you already read https://docs.moodle.org/dev/Environment_checking ?

At first glance, it looks like you're missing the parent node <COMPATIBILITY_MATRIX/> in your XML: see more at https://moodle.org/mod/forum/discuss.php?d=368725#p1487060.

HTH,
Matteo

 
Average of ratings: -
Picture of Steffen Hippeli
Re: environment.xml for plugin ignored
Plugin developers
Thanks for your quick answer. I read the docs and also tried

<?xml version="1.0" encoding="UTF-8" ?>
<COMPATIBILITY_MATRIX>
<PLUGIN name="mod_edusharing">
<PHP_EXTENSIONS>
<PHP_EXTENSION name="soap" level="required"/>
<PHP_EXTENSION name="curl" level="required"/>
</PHP_EXTENSIONS>
</PLUGIN>
</COMPATIBILITY_MATRIX>
with no success. 
 
Average of ratings: -