MDL-41230 tool_uploadcourse: Prevent max_execution_time issues

This commit is contained in:
Frederic Massart 2013-10-03 11:44:54 +08:00
parent d45e65ccad
commit 97376662df

View File

@ -194,6 +194,10 @@ class tool_uploadcourse_processor {
$deleted = 0;
$errors = 0;
// We will most certainly need extra time and memory to process big files.
@set_time_limit(0);
raise_memory_limit(MEMORY_EXTRA);
// Loop over the CSV lines.
while ($line = $this->cir->next()) {
$this->linenb++;
@ -330,6 +334,10 @@ class tool_uploadcourse_processor {
}
$tracker->start();
// We might need extra time and memory depending on the number of rows to preview.
@set_time_limit(0);
raise_memory_limit(MEMORY_EXTRA);
// Loop over the CSV lines.
$preview = array();
while (($line = $this->cir->next()) && $rows > $this->linenb) {