MDL-58746 core: Simplify environment check

This commit is contained in:
Andrew Nicols 2017-05-03 08:32:04 +08:00
parent 4270ebea38
commit d98d245ba0
3 changed files with 1 additions and 23 deletions

View file

@ -2004,6 +2004,7 @@
<PHP_EXTENSION name="json" level="required"> <PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION> </PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/> <PHP_EXTENSION name="hash" level="required"/>
<PHP_EXTENSION name="fileinfo" level="required"/>
</PHP_EXTENSIONS> </PHP_EXTENSIONS>
<PHP_SETTINGS> <PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="96M" level="required"> <PHP_SETTING name="memory_limit" value="96M" level="required">
@ -2078,11 +2079,6 @@
<ON_CHECK message="incompleteunicodesupport" /> <ON_CHECK message="incompleteunicodesupport" />
</FEEDBACK> </FEEDBACK>
</CUSTOM_CHECK> </CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_finfo" level="required">
<FEEDBACK>
<ON_ERROR message="finforequired" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS> </CUSTOM_CHECKS>
</MOODLE> </MOODLE>
</COMPATIBILITY_MATRIX> </COMPATIBILITY_MATRIX>

View file

@ -623,7 +623,6 @@ It is recommended to install local copy of free GeoLite2 City database from MaxM
IP address location is displayed on simple map or using Google Maps. Please note that you need to have a Google account and apply for free Google Maps API key to enable interactive maps.'; IP address location is displayed on simple map or using Google Maps. Please note that you need to have a Google account and apply for free Google Maps API key to enable interactive maps.';
$string['iplookupmaxmindnote'] = 'This product includes GeoLite2 data created by MaxMind, available from <a href="http://www.maxmind.com">http://www.maxmind.com</a>.'; $string['iplookupmaxmindnote'] = 'This product includes GeoLite2 data created by MaxMind, available from <a href="http://www.maxmind.com">http://www.maxmind.com</a>.';
$string['ishttpswarning'] = 'It has been detected that your site is not secured using HTTPS. For increased security and improved integrations with other systems is highly recommended to migrate your site to HTTPS.'; $string['ishttpswarning'] = 'It has been detected that your site is not secured using HTTPS. For increased security and improved integrations with other systems is highly recommended to migrate your site to HTTPS.';
$string['finforequired'] = 'The finfo PHP extension is now required by Moodle, in order to improve mimetype decoding.';
$string['keeptagnamecase'] = 'Keep tag name casing'; $string['keeptagnamecase'] = 'Keep tag name casing';
$string['lang'] = 'Default language'; $string['lang'] = 'Default language';
$string['langcache'] = 'Cache language menu'; $string['langcache'] = 'Cache language menu';

View file

@ -2516,20 +2516,3 @@ function check_libcurl_version(environment_results $result) {
return null; return null;
} }
/**
* Check if the finfo class is present.
*
* @param environment_results $result object to update, if relevant.
* @return environment_results|null updated results or null.
*/
function check_finfo(environment_results $result) {
if (!class_exists('finfo')) {
$result->setInfo('finfo extension not enabled');
$result->setStatus(false);
return $result;
}
return null;
}