Abstracted a bit of the restore procedure to allow for silent restoring.

Added new function, import_backup_file_silently
Changed everything that prints stuff to check for a constant first.
Backup_flush checks a different constant, this is so that output can still
get flushed to the browser when necessary but not print <li>s everywhere.
Please test this!
This commit is contained in:
mjollnir_
2006-01-15 21:09:13 +00:00
parent f16021da64
commit f90666aa5c
22 changed files with 1582 additions and 829 deletions
+28 -16
View File
@@ -75,7 +75,9 @@
$newid = insert_record ("exercise",$exercise);
//Do some output
echo "<li>".get_string("modulename","exercise")." \"".format_string(stripslashes($exercise->name),true)."\"</li>";
if (!defined('RESTORE_SILENTLY')) {
echo "<li>".get_string("modulename","exercise")." \"".format_string(stripslashes($exercise->name),true)."\"</li>";
}
backup_flush(300);
if ($newid) {
@@ -126,9 +128,11 @@
//Do some output
if (($i+1) % 10 == 0) {
echo ".";
if (($i+1) % 200 == 0) {
echo "<br />";
if (!defined('RESTORE_SILENTLY')) {
echo ".";
if (($i+1) % 200 == 0) {
echo "<br />";
}
}
backup_flush(300);
}
@@ -174,9 +178,11 @@
//Do some output
if (($i+1) % 10 == 0) {
echo ".";
if (($i+1) % 200 == 0) {
echo "<br />";
if (!defined('RESTORE_SILENTLY')) {
echo ".";
if (($i+1) % 200 == 0) {
echo "<br />";
}
}
backup_flush(300);
}
@@ -233,9 +239,11 @@
//Do some output
if (($i+1) % 50 == 0) {
echo ".";
if (($i+1) % 1000 == 0) {
echo "<br />";
if (!defined('RESTORE_SILENTLY')) {
echo ".";
if (($i+1) % 1000 == 0) {
echo "<br />";
}
}
backup_flush(300);
}
@@ -305,9 +313,11 @@
//Do some output
if (($i+1) % 50 == 0) {
echo ".";
if (($i+1) % 1000 == 0) {
echo "<br />";
if (!defined('RESTORE_SILENTLY')) {
echo ".";
if (($i+1) % 1000 == 0) {
echo "<br />";
}
}
backup_flush(300);
}
@@ -360,9 +370,11 @@
//Do some output
if (($i+1) % 50 == 0) {
echo ".";
if (($i+1) % 1000 == 0) {
echo "<br />";
if (!defined('RESTORE_SILENTLY')) {
echo ".";
if (($i+1) % 1000 == 0) {
echo "<br />";
}
}
backup_flush(300);
}