]> git.mjollnir.org Git - moodle.git/commitdiff
Added some flush() to the backup process (in users, questions and logs)
authorstronk7 <stronk7>
Mon, 7 Jul 2003 18:26:11 +0000 (18:26 +0000)
committerstronk7 <stronk7>
Mon, 7 Jul 2003 18:26:11 +0000 (18:26 +0000)
backup/backuplib.php
backup/mod/quiz/backuplib.php

index 8250e7719d18abd4e0bbc8295e114ee938fa98b1..e17f5c25301b7f84c1160ba4c6e928501077065b 100644 (file)
         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
                 }
                 //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));
         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
                     //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));
index 824ee00076c3234f08538cda92e02a3e0517b17e..2c70452c7e92d5a1293c35e688dd149f0274511f 100644 (file)
         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
                 }
                 //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));