From 6726e93db58859a7efd9feb621068bde85f3057f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Oct 2009 07:53:17 +0200 Subject: [PATCH] Fixed bug in DB Upgrade Wizard restore step - selection table of backups was empty. --- setup/upgrade/steps/upgradeRestore.php | 49 ++++++++++++++++--------------------------------- setup/upgrade/upgradeUtil.php | 3 +++ 2 files changed, 19 insertions(+), 33 deletions(-) diff --git a/setup/upgrade/steps/upgradeRestore.php b/setup/upgrade/steps/upgradeRestore.php index 290e62e..331e8dc 100644 --- a/setup/upgrade/steps/upgradeRestore.php +++ b/setup/upgrade/steps/upgradeRestore.php @@ -105,7 +105,7 @@ class upgradeRestore extends Step { */ private function storeSilent() { } - + /* // these belong in a shared lib function set_state($value) { @@ -123,19 +123,16 @@ function check_state($value, $state='Home') exit; } } - +*/ function restore() { - check_state(1); - set_state(5); +// check_state(1); +// set_state(5); // title('Restore In Progress'); $status = $_SESSION['backupStatus']; - $filename=$_SESSION['backupFile']; - $stmt=create_restore_stmt($filename); - $dir=$stmt['dir']; - - - + $filename = $_SESSION['backupFile']; + $stmt = $this->util->create_restore_stmt($filename); + $dir = $stmt['dir']; if (is_file($dir . '/mysql') || is_file($dir . '/mysql.exe')) { @@ -166,20 +163,8 @@ function check_state($value, $state='Home') $_SESSION['restoreOutput']=$read; } - - - - $_SESSION['restoreStatus'] = $ok; - -?> - -temp_variables['availableBackups'] = false; // title('Select Backup to Restore'); - - $dir = $this->resolveTempDir(); + $dir = $this->util->resolveTempDir(); $files = array(); if ($dh = opendir($dir)) @@ -263,10 +246,10 @@ function restoreSelect() closedir($dh); } - $this->temp_variables['availableBackups'] = false; $this->temp_variables['dir'] = $dir; if (count($files) != 0) { $this->temp_variables['availableBackups'] = true; + $this->temp_variables['files'] = $files; } } @@ -274,7 +257,7 @@ function restoreSelected() { $file=$_REQUEST['file']; - $dir = $this->resolveTempDir(); + $dir = $this->util->resolveTempDir(); $_SESSION['backupFile'] = $dir . '/' . $file; ?> create_restore_stmt($filename); + $filename = $_SESSION['backupFile']; + $stmt = $this->util->create_restore_stmt($filename); $this->temp_variables['dir'] = $stmt['dir']; $this->temp_variables['display'] = $stmt['display']; diff --git a/setup/upgrade/upgradeUtil.php b/setup/upgrade/upgradeUtil.php index e13c97f..c1cb32a 100644 --- a/setup/upgrade/upgradeUtil.php +++ b/setup/upgrade/upgradeUtil.php @@ -39,6 +39,9 @@ * @package Upgrader * @version Version 0.1 */ + +require '../../config/dmsDefaults.php'; + class UpgradeUtil { /** * Constructs upgradeation object -- libgit2 0.21.4