From 210b4c4883a3b45c29a0dd2098030484ad16af6e Mon Sep 17 00:00:00 2001 From: "Paula V. Quispe" Date: Thu, 21 May 2015 15:19:42 -0400 Subject: [PATCH] PM-2795: I solved the problem with port --- workflow/engine/bin/tasks/cliWorkspaces.php | 4 +++- workflow/engine/classes/class.wsTools.php | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/workflow/engine/bin/tasks/cliWorkspaces.php b/workflow/engine/bin/tasks/cliWorkspaces.php index 103e70fa2..f2bc099f6 100755 --- a/workflow/engine/bin/tasks/cliWorkspaces.php +++ b/workflow/engine/bin/tasks/cliWorkspaces.php @@ -75,6 +75,7 @@ CLI::taskOpt("multiple", "Restore from multiple compresed enumerated files.", "m CLI::taskOpt("workspace", "Select which workspace to restore if multiple workspaces are present in the archive.", "w:", "workspace="); CLI::taskOpt("lang", "You must specify language on which rebuild of the case cache list builder will be done; if you don't specify this, it will use 'en' by default", "l:","lang="); +CLI::taskOpt("port", "You must specify mysql port.", "p:"); CLI::taskRun("run_workspace_restore"); CLI::taskName('cacheview-repair'); @@ -551,6 +552,7 @@ function run_workspace_restore($args, $opts) { } $info = array_key_exists("info", $opts); $lang = array_key_exists("lang", $opts) ? $opts['lang'] : 'en'; + $port = array_key_exists("port", $opts) ? $opts['port'] : ''; if ($info) { workspaceTools::getBackupInfo($filename); } else { @@ -578,7 +580,7 @@ function run_workspace_restore($args, $opts) { CLI::error("Please, you should use -m parameter to restore them.\n"); return; } - workspaceTools::restore($filename, $workspace, $dstWorkspace, $overwrite, $lang); + workspaceTools::restore($filename, $workspace, $dstWorkspace, $overwrite, $lang, $port ); } } } diff --git a/workflow/engine/classes/class.wsTools.php b/workflow/engine/classes/class.wsTools.php index 23ff0a97c..730d4e785 100755 --- a/workflow/engine/classes/class.wsTools.php +++ b/workflow/engine/classes/class.wsTools.php @@ -1434,7 +1434,7 @@ class workspaceTools * @param string $newWorkspaceName if defined, supplies the name for the * workspace to restore to */ - static public function restore($filename, $srcWorkspace, $dstWorkspace = null, $overwrite = true, $lang = 'en') + static public function restore($filename, $srcWorkspace, $dstWorkspace = null, $overwrite = true, $lang = 'en', $port = '') { G::LoadThirdParty('pear/Archive', 'Tar'); $backup = new Archive_Tar($filename); @@ -1553,6 +1553,9 @@ class workspaceTools CLI::logging(CLI::error("Could not get the shared folder permissions, not changing workspace permissions") . "\n"); } list ($dbHost, $dbUser, $dbPass) = @explode(SYSTEM_HASH, G::decrypt(HASH_INSTALLATION, SYSTEM_HASH)); + if($port != ''){ + $dbHost = $dbHost.$port; + } $aParameters = array('dbHost'=>$dbHost,'dbUser'=>$dbUser,'dbPass'=>$dbPass); CLI::logging("> Connecting to system database in '$dbHost'\n"); $link = mysql_connect($dbHost, $dbUser, $dbPass); @@ -2011,6 +2014,7 @@ class workspaceTools $data = $row; $data["DEL_INDEX"] = $row["APP_DEL_INDEX"]; $listPaused = new ListPaused(); + $listPaused ->remove($row["APP_UID"],$row["APP_DEL_INDEX"],$data); $listPaused->setDeleted(false); $listPaused->create($data); }