diff --git a/setup/upgrade/steps/upgradeBackup.php b/setup/upgrade/steps/upgradeBackup.php
index 158c11d..47db877 100644
--- a/setup/upgrade/steps/upgradeBackup.php
+++ b/setup/upgrade/steps/upgradeBackup.php
@@ -110,8 +110,10 @@ class upgradeBackup extends Step {
$this->backupConfirm();
}
else {
- $this->temp_variables['title'] = 'Backup In Progress';
+ $this->temp_variables['title'] = 'Backup Created';
$this->backup();
+ // TODO error checking (done in backupDone at the moment)
+ $this->backupDone();
}
$this->storeSilent();// Set silent mode variables
@@ -125,6 +127,7 @@ class upgradeBackup extends Step {
private function storeSilent() {
}
+ /*
// these belong in a shared lib
function set_state($value)
{
@@ -142,34 +145,25 @@ function check_state($value, $state='Home')
exit;
}
}
+*/
private function backup() {
// $this->check_state(1);
// $this->set_state(2);
- $targetfile=$_SESSION['backupFile'];
+ $targetfile = $_SESSION['backupFile'];
$stmt = $this->create_backup_stmt($targetfile);
$dir = $stmt['dir'];
if (is_file($dir . '/mysqladmin') || is_file($dir . '/mysqladmin.exe'))
{
- ob_flush();
- flush();
- ?>
- The backup is now underway. Please wait till it completes.
- resolveTempDir();
+ $dir = $this->resolveTempDir();
$_SESSION['backupFile'] = $stmt['target'];
if (OS_UNIX) {
@@ -197,75 +191,52 @@ function check_state($value, $state='Home')
private function backupDone() {
// $this->check_state(2);
// $this->set_state(3);
- title('Backup Status');
+// title('Backup Status');
$status = $_SESSION['backupStatus'];
- $filename=$_SESSION['backupFile'];
+ $filename = $_SESSION['backupFile'];
+
+ $this->temp_variables['backupStatus'] = $status;
if ($status)
{
- $stmt=create_restore_stmt($filename);
- ?>
- The backup file "" has been created.
+ $stmt = $this->util->create_restore_stmt($filename);
+ $this->temp_variables['display'] = 'The backup file "" has been created.
It appears as though the backup has been successful.
-
- ';
if ($stmt['dir'] != '')
{
- ?>
- Manually, you would do the following to restore the backup:
+ $this->temp_variables['dir'] = $stmt['dir'];
+ $this->temp_variables['display'] .= 'Manually, you would do the following to restore the backup:
- cd
-
- cd ' . $stmt['dir'] . '
+ ';
}
else
{
- ?>
- The mysql backup utility could not be found automatically. Please edit the config.ini and update the backup/mysql Directory entry.
+ $this->temp_variables['display'] .= 'The mysql backup utility could not be found automatically. Please edit the config.ini and update the backup/mysql Directory entry.
If you need to restore from this backup, you should be able to use the following statements:
';
}
else
{
- ?>
- It appears as though the backup process has failed. Unfortunately, it is difficult to diagnose these problems automatically
+ $this->temp_variables['display'] .= 'It appears as though the backup process has failed. Unfortunately, it is difficult to diagnose these problems automatically
and would recommend that you try to do the backup process manually.