MDL-28526 glossary: extra time and memory for export/import
authorMarina Glancy <marina@moodle.com>
Fri, 20 Mar 2015 07:02:32 +0000 (15:02 +0800)
committerMarina Glancy <marina@moodle.com>
Fri, 20 Mar 2015 07:02:32 +0000 (15:02 +0800)
mod/glossary/import.php
mod/glossary/lib.php

index 50a3eba..87783e7 100644 (file)
@@ -77,6 +77,10 @@ if (empty($result)) {
     die();
 }
 
+// Large exports are likely to take their time and memory.
+core_php_time_limit::raise();
+raise_memory_limit(MEMORY_EXTRA);
+
 if ($xml = glossary_read_imported_file($result)) {
     $importedentries = 0;
     $importedcats    = 0;
index cc1d69a..3db0791 100644 (file)
@@ -2262,6 +2262,10 @@ function glossary_generate_export_csv($entries, $aliases, $categories) {
 function glossary_generate_export_file($glossary, $ignored = "", $hook = 0) {
     global $CFG, $DB;
 
+    // Large exports are likely to take their time and memory.
+    core_php_time_limit::raise();
+    raise_memory_limit(MEMORY_EXTRA);
+
     $cm = get_coursemodule_from_instance('glossary', $glossary->id, $glossary->course);
     $context = context_module::instance($cm->id);