Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-20591 check for min libxml 2.6.30 version on ims-cc import

  • Loading branch information...
commit 56788d24ddc7ef4dd32a6981600f7c7b03168a9a 1 parent 05f337c
stronk7 authored
Showing with 8 additions and 2 deletions.
  1. +5 −0 backup/cc/restore_cc.php
  2. +3 −2 lang/en_utf8/imscc.php
View
5 backup/cc/restore_cc.php
@@ -53,6 +53,10 @@ function cc_convert ($dir) {
return false;
}
+ if (!$detected_requirements["libxmlminversion"]) {
+ notify(get_string('cc_import_req_libxmlminversion', 'imscc'));
+ return false;
+ }
if (!$detected_requirements["xsl"]) {
notify(get_string('cc_import_req_xsl', 'imscc'));
return false;
@@ -102,6 +106,7 @@ function detect_requirements () {
$detected["xsl"] = extension_loaded('xsl');
$detected['dom'] = extension_loaded('dom');
$detected['libxml'] = extension_loaded('libxml');
+ $detected['libxmlminversion'] = extension_loaded('libxml') && version_compare(LIBXML_DOTTED_VERSION, '2.6.30', '>=');
return $detected;
View
5 lang/en_utf8/imscc.php
@@ -1,10 +1,11 @@
<?php
$string['enable_cc_import'] = 'Enable CC Import';
-$string['enable_cc_import_description'] = 'This setting enables the import of Common Cartridge (IMS-CC) packages using the standard restore functionality. Note it requires PHP5, DOM, XSL and LIBXML extensions to be installed in the server.';
+$string['enable_cc_import_description'] = 'This setting enables the import of Common Cartridge (IMS-CC) packages using the standard restore functionality. Note it requires PHP5, DOM, XSL and LIBXML (2.6.30 or newer) extensions to be installed in the server.';
$string['cc_import_req_php5'] = 'ERROR: The Common Cartridge import requires PHP 5 or highter.';
$string['cc_import_req_xsl'] = 'ERROR: The Common Cartridge import requires XSL.';
$string['cc_import_req_dom'] = 'ERROR: The Common Cartridge import requires DOM extension.';
-$string['cc_import_req_libxml'] = 'ERROR: The Common Cartridge import requires LIBXML extension';
+$string['cc_import_req_libxml'] = 'ERROR: The Common Cartridge import requires LIBXML extension.';
+$string['cc_import_req_libxmlminversion'] = 'ERROR: The Common Cartridge import requires LIBXML version 2.6.30 or newer.';
$string['cc2moodle_checking_schema'] = 'CC Format! Checking Schema...';
$string['cc2moodle_valid_schema'] = 'Schema Valid!';
$string['cc2moodle_req_auth'] = 'ERROR: The Common Cartridge package requires authorization.';
Please sign in to comment.
Something went wrong with that request. Please try again.