Permalink
Browse files

Changes to work with data from fs instead of db.

Show progress info
Output data to the browser to avoid timeouts.
  • Loading branch information...
1 parent adc8b0c commit 832876628016be1c56e76b8d767610ec20f25062 stronk7 committed Jun 20, 2003
View
11 backup/mod/assignment/restorelib.php
@@ -32,11 +32,8 @@ function assignment_restore_mods($mod,$restore) {
$data = backup_getid($restore->backup_unique_code,$mod->modtype,$mod->id);
if ($data) {
- //We have info, get and unserialize info
- //First strip slashes
- $temp = stripslashes($data->info);
//Now get completed xmlized object
- $info = unserialize($temp);
+ $info = $data->info;
//traverse_xmlize($info); //Debug
//print_object ($GLOBALS['traverse_array']); //Debug
//$GLOBALS['traverse_array']=""; //Debug
@@ -57,7 +54,7 @@ function assignment_restore_mods($mod,$restore) {
$newid = insert_record ("assignment",$assignment);
//Do some output
- echo "<ul><li>Assignment ".$assignment->name."<br>";
+ echo "<ul><li>Assignment \"".$assignment->name."\"<br>";
backup_flush(300);
if ($newid) {
@@ -132,9 +129,9 @@ function assignment_submissions_restore_mods($old_assignment_id, $new_assignment
$newid = insert_record ("assignment_submissions",$submission);
//Do some output
- if ($newid % 50 == 0) {
+ if (($i+1) % 50 == 0) {
echo ".";
- if ($newid % 1000 == 0) {
+ if (($i+1) % 1000 == 0) {
echo "<br>";
}
backup_flush(300);
View
11 backup/mod/choice/restorelib.php
@@ -32,11 +32,8 @@ function choice_restore_mods($mod,$restore) {
$data = backup_getid($restore->backup_unique_code,$mod->modtype,$mod->id);
if ($data) {
- //We have info, get and unserialize info
- //First strip slashes
- $temp = stripslashes($data->info);
//Now get completed xmlized object
- $info = unserialize($temp);
+ $info = $data->info;
//traverse_xmlize($info); //Debug
//print_object ($GLOBALS['traverse_array']); //Debug
//$GLOBALS['traverse_array']=""; //Debug
@@ -59,7 +56,7 @@ function choice_restore_mods($mod,$restore) {
$newid = insert_record ("choice",$choice);
//Do some output
- echo "<ul><li>Choice ".$choice->name."<br>";
+ echo "<ul><li>Choice \"".$choice->name."\"<br>";
backup_flush(300);
if ($newid) {
@@ -122,9 +119,9 @@ function choice_answers_restore_mods($choice_id,$info,$restore) {
$newid = insert_record ("choice_answers",$answer);
//Do some output
- if ($newid % 50 == 0) {
+ if (($i+1) % 50 == 0) {
echo ".";
- if ($newid % 1000 == 0) {
+ if (($i+1) % 1000 == 0) {
echo "<br>";
}
backup_flush(300);
View
7 backup/mod/resource/restorelib.php
@@ -27,11 +27,8 @@ function resource_restore_mods($mod,$restore) {
$data = backup_getid($restore->backup_unique_code,$mod->modtype,$mod->id);
if ($data) {
- //We have info, get and unserialize info
- //First strip slashes
- $temp = stripslashes($data->info);
//Now get completed xmlized object
- $info = unserialize($temp);
+ $info = $data->info;
//traverse_xmlize($info); //Debug
//print_object ($GLOBALS['traverse_array']); //Debug
//$GLOBALS['traverse_array']=""; //Debug
@@ -49,7 +46,7 @@ function resource_restore_mods($mod,$restore) {
$newid = insert_record ("resource",$resource);
//Do some output
- echo "<ul><li>Resource ".$resource->name."<br>";
+ echo "<ul><li>Resource \"".$resource->name."\"<br>";
backup_flush(300);
if ($newid) {
View
15 backup/mod/survey/restorelib.php
@@ -33,11 +33,8 @@ function survey_restore_mods($mod,$restore) {
$data = backup_getid($restore->backup_unique_code,$mod->modtype,$mod->id);
if ($data) {
- //We have info, get and unserialize info
- //First strip slashes
- $temp = stripslashes($data->info);
//Now get completed xmlized object
- $info = unserialize($temp);
+ $info = $data->info;
//traverse_xmlize($info); //Debug
//print_object ($GLOBALS['traverse_array']); //Debug
//$GLOBALS['traverse_array']=""; //Debug
@@ -56,7 +53,7 @@ function survey_restore_mods($mod,$restore) {
$newid = insert_record ("survey",$survey);
//Do some output
- echo "<ul><li>Survey ".$survey->name."<br>";
+ echo "<ul><li>Survey \"".$survey->name."\"<br>";
backup_flush(300);
if ($newid) {
@@ -125,9 +122,9 @@ function survey_answers_restore_mods($survey_id,$info,$restore) {
$newid = insert_record ("survey_answers",$answer);
//Do some output
- if ($newid % 50 == 0) {
+ if (($i+1) % 50 == 0) {
echo ".";
- if ($newid % 1000 == 0) {
+ if (($i+1) % 1000 == 0) {
echo "<br>";
}
backup_flush(300);
@@ -181,9 +178,9 @@ function survey_analysis_restore_mods($survey_id,$info,$restore) {
$newid = insert_record ("survey_analysis",$analys);
//Do some output
- if ($newid % 50 == 0) {
+ if (($i+1) % 50 == 0) {
echo ".";
- if ($newid % 1000 == 0) {
+ if (($i+1) % 1000 == 0) {
echo "<br>";
}
backup_flush(300);

0 comments on commit 8328766

Please sign in to comment.