From 55513d3ec5fa5fd2bb92a159306a7559105a959b Mon Sep 17 00:00:00 2001 From: stronk7 Date: Wed, 11 Jun 2003 19:13:07 +0000 Subject: [PATCH] Changed max_execution_time and memory_limit php variables to execute long and heavy scripts (restore and backup) :-) Only affects current script execution --- backup/backup.php | 6 +++++- backup/restore.php | 12 ++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/backup/backup.php b/backup/backup.php index e310ab0bc4e..7fae70390cf 100644 --- a/backup/backup.php +++ b/backup/backup.php @@ -74,6 +74,11 @@ //Print form print_heading("$strcoursebackup: $course->fullname ($course->shortname)"); print_simple_box_start("center", "", "$THEME->cellheading"); + + //Adjust some php variables to the execution of this script + ini_set("max_execution_time","300"); + ini_set("memory_limit","56M"); + //Call the form, depending the step we are if (!$launch) { include_once("backup_form.html"); @@ -88,4 +93,3 @@ print_footer(); ?> - diff --git a/backup/restore.php b/backup/restore.php index aa7840b74cd..274bcc608fb 100644 --- a/backup/restore.php +++ b/backup/restore.php @@ -38,7 +38,12 @@ } //Check backup_version - upgrade_backup_db($backup_version,$backup_release,"restore.php"); + if ($file) { + $linkto = "restore.php?file=".$file; + } else { + $linkto = "restore.php"; + } + upgrade_backup_db($backup_version,$backup_release,$linkto); //Get strings $strcourserestore = get_string("courserestore"); @@ -72,6 +77,10 @@ //Print form print_heading("$strcourserestore: ".basename($file)); print_simple_box_start("center", "", "$THEME->cellheading"); + + //Adjust some php variables to the execution of this script + ini_set("max_execution_time","300"); + ini_set("memory_limit","56M"); //Call the form, depending the step we are if (!$launch) { @@ -89,4 +98,3 @@ print_footer(); ?> -