Permalink
Browse files

Added some flush() to the backup process (in users, questions and logs)

  • Loading branch information...
stronk7
stronk7 committed Jul 7, 2003
1 parent 5da9e4a commit d48370a60b5e01c490a2fd33feb2a48b64aef10b
Showing with 30 additions and 0 deletions.
  1. +20 −0 backup/backuplib.php
  2. +10 −0 backup/mod/quiz/backuplib.php
View
@@ -549,6 +549,7 @@ function backup_user_info ($bf,$preferences) {
if ($users) {
//Begin Users tag
fwrite ($bf,start_tag("USERS",2,true));
+ $counter = 0;
//With every user
foreach ($users as $user) {
//Get user data from table
@@ -654,6 +655,15 @@ function backup_user_info ($bf,$preferences) {
}
//End User tag
fwrite ($bf,end_tag("USER",3,true));
+ //Do some output
+ $counter++;
+ if ($counter % 10 == 0) {
+ echo ".";
+ if ($counter % 200 == 0) {
+ echo "<br>";
+ }
+ backup_flush(300);
+ }
}
//End Users tag
fwrite ($bf,end_tag("USERS",2,true));
@@ -678,6 +688,7 @@ function backup_log_info($bf,$preferences) {
if ($logs) {
//Pring logs header
fwrite ($bf,start_tag("LOGS",2,true));
+ $counter = 0;
//Iterate
foreach ($logs as $log) {
//See if it is a valid module to backup
@@ -700,6 +711,15 @@ function backup_log_info($bf,$preferences) {
//End log tag
fwrite ($bf,end_tag("LOG",3,true));
}
+ //Do some output
+ $counter++;
+ if ($counter % 10 == 0) {
+ echo ".";
+ if ($counter % 200 == 0) {
+ echo "<br>";
+ }
+ backup_flush(300);
+ }
}
//End logs tag
$status = fwrite ($bf,end_tag("LOGS",2,true));
@@ -124,6 +124,7 @@ function quiz_backup_question($bf,$preferences,$category) {
if ($questions) {
//Write start tag
$status =fwrite ($bf,start_tag("QUESTIONS",4,true));
+ $counter = 0;
//Iterate over each question
foreach ($questions as $question) {
//Start question
@@ -153,6 +154,15 @@ function quiz_backup_question($bf,$preferences,$category) {
}
//End question
$status =fwrite ($bf,end_tag("QUESTION",5,true));
+ //Do some output
+ $counter++;
+ if ($counter % 10 == 0) {
+ echo ".";
+ if ($counter % 200 == 0) {
+ echo "<br>";
+ }
+ backup_flush(300);
+ }
}
//Write end tag
$status =fwrite ($bf,end_tag("QUESTIONS",4,true));

0 comments on commit d48370a

Please sign in to comment.