HOR-4529
This commit is contained in:
@@ -71,8 +71,11 @@ class DBSession
|
||||
* @return void
|
||||
*
|
||||
*/
|
||||
function setTo ($objConnection = null, $strDBName = DB_NAME)
|
||||
function setTo ($objConnection = null, $strDBName = null)
|
||||
{
|
||||
if (empty($strDBName)) {
|
||||
$strDBName = config("connections.workflow.database");
|
||||
}
|
||||
if ($objConnection != null) {
|
||||
$this->Free();
|
||||
$this->dbc = $objConnection;
|
||||
@@ -95,8 +98,11 @@ class DBSession
|
||||
* @return void
|
||||
*
|
||||
*/
|
||||
function UseDB ($strDBName = DB_NAME)
|
||||
function UseDB ($strDBName = null)
|
||||
{
|
||||
if (empty($strDBName)) {
|
||||
$strDBName = config("connections.workflow.database");
|
||||
}
|
||||
$this->dbname = $strDBName;
|
||||
}
|
||||
|
||||
|
||||
@@ -344,15 +344,23 @@ CLI::taskRun("regenerate_pmtable_classes");
|
||||
|
||||
/**
|
||||
* Function run_info
|
||||
* access public
|
||||
*
|
||||
* @param array $args
|
||||
* @param array $opts
|
||||
*/
|
||||
function run_info($args, $opts)
|
||||
{
|
||||
$workspaces = get_workspaces_from_args($args);
|
||||
WorkspaceTools::printSysInfo();
|
||||
|
||||
//Check if the command is executed by a specific workspace
|
||||
$workspaces = get_workspaces_from_args($args);
|
||||
if (count($args) === 1) {
|
||||
$workspaces[0]->printMetadata(false);
|
||||
} else {
|
||||
foreach ($workspaces as $workspace) {
|
||||
echo "\n";
|
||||
$workspace->printMetadata(false);
|
||||
passthru(PHP_BINARY . " processmaker info " . $workspace->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -865,21 +873,31 @@ function run_workspace_restore($args, $opts)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Migrating cases folders of the workspaces
|
||||
*
|
||||
* @param array $command
|
||||
* @param array $args
|
||||
*/
|
||||
function runStructureDirectories($command, $args)
|
||||
{
|
||||
$workspaces = get_workspaces_from_args($command);
|
||||
$count = count($workspaces);
|
||||
$errors = false;
|
||||
$countWorkspace = 0;
|
||||
foreach ($workspaces as $index => $workspace) {
|
||||
if (count($command) === 1) {
|
||||
try {
|
||||
$countWorkspace++;
|
||||
CLI::logging("Updating workspaces ($countWorkspace/$count): " . CLI::info($workspace->name) . "\n");
|
||||
$workspace = $workspaces[0];
|
||||
CLI::logging(": " . CLI::info($workspace->name) . "\n");
|
||||
$workspace->updateStructureDirectories($workspace->name);
|
||||
$workspace->close();
|
||||
} catch (Exception $e) {
|
||||
CLI::logging("Errors upgrading workspace " . CLI::info($workspace->name) . ": " . CLI::error($e->getMessage()) . "\n");
|
||||
$errors = true;
|
||||
}
|
||||
} else {
|
||||
$count = count($workspaces);
|
||||
$countWorkspace = 0;
|
||||
foreach ($workspaces as $index => $workspace) {
|
||||
$countWorkspace++;
|
||||
CLI::logging("Updating workspaces ($countWorkspace/$count)");
|
||||
passthru(PHP_BINARY . " processmaker migrate-cases-folders " . $workspace->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user