This commit is contained in:
Roly Rudy Gutierrez Pinto
2018-06-15 16:24:13 -04:00
parent 0a7b8cd5b7
commit 9a8f62b94b
3 changed files with 13 additions and 13 deletions

View File

@@ -9,7 +9,7 @@ CLI::taskDescription("Upgrade workspaces.\n\n This command should be run after u
CLI::taskOpt('buildACV', 'If this option is enabled, the Cache View is built.', 'ACV', 'buildACV'); CLI::taskOpt('buildACV', 'If this option is enabled, the Cache View is built.', 'ACV', 'buildACV');
CLI::taskOpt('noxml', 'If this option is enabled, the XML files translation is not built.', 'NoXml', 'no-xml'); CLI::taskOpt('noxml', 'If this option is enabled, the XML files translation is not built.', 'NoXml', 'no-xml');
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
CLI::taskOpt('include_dyn_content', "Include the DYN_CONTENT_HISTORY value. Ex: --include_dyn_content", 'i', 'include_dyn_content'); CLI::taskOpt('keep_dyn_content', "Include the DYN_CONTENT_HISTORY value. Ex: --keep_dyn_content", 'i', 'keep_dyn_content');
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
CLI::taskRun("run_upgrade"); CLI::taskRun("run_upgrade");
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
@@ -112,7 +112,7 @@ function run_upgrade($command, $args)
$flagUpdateXml = !array_key_exists('noxml', $args); $flagUpdateXml = !array_key_exists('noxml', $args);
$optionMigrateHistoryData = [ $optionMigrateHistoryData = [
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
'includeDynContent' => array_key_exists('include_dyn_content', $args) 'keepDynContent' => array_key_exists('keep_dyn_content', $args)
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
]; ];

View File

@@ -51,7 +51,7 @@ CLI::taskOpt("workspace", "Specify which workspace to restore if multiple worksp
CLI::taskOpt("lang", "Specify the language which will be used to rebuild the case cache list. If this option isn't included, then 'en' (English) will be used by default.", "l:", "lang="); CLI::taskOpt("lang", "Specify the language which will be used to rebuild the case cache list. If this option isn't included, then 'en' (English) will be used by default.", "l:", "lang=");
CLI::taskOpt("port", "Specify the port number used by MySQL. If not specified, then the port 3306 will be used by default.", "p:"); CLI::taskOpt("port", "Specify the port number used by MySQL. If not specified, then the port 3306 will be used by default.", "p:");
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
CLI::taskOpt('include_dyn_content', "Include the DYN_CONTENT_HISTORY value. Ex: --include_dyn_content", 'd', 'include_dyn_content'); CLI::taskOpt('keep_dyn_content', "Include the DYN_CONTENT_HISTORY value. Ex: --keep_dyn_content", 'd', 'keep_dyn_content');
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
CLI::taskRun("run_workspace_restore"); CLI::taskRun("run_workspace_restore");
@@ -356,7 +356,7 @@ EOT
); );
CLI::taskArg('workspace'); CLI::taskArg('workspace');
CLI::taskRun('migrate_history_data'); CLI::taskRun('migrate_history_data');
CLI::taskOpt('include_dyn_content', "Include the DYN_CONTENT_HISTORY value. Ex: --include_dyn_content", 'i', 'include_dyn_content'); CLI::taskOpt('keep_dyn_content', "Include the DYN_CONTENT_HISTORY value. Ex: --keep_dyn_content", 'i', 'keep_dyn_content');
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
/** /**
@@ -859,7 +859,7 @@ function run_workspace_restore($args, $opts)
$port = array_key_exists("port", $opts) ? $opts['port'] : ''; $port = array_key_exists("port", $opts) ? $opts['port'] : '';
$optionMigrateHistoryData = [ $optionMigrateHistoryData = [
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
'includeDynContent' => array_key_exists('include_dyn_content', $args) 'keepDynContent' => array_key_exists('keep_dyn_content', $args)
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
]; ];
if ($info) { if ($info) {
@@ -1301,17 +1301,17 @@ function regenerate_pmtable_classes($args, $opts)
function migrate_history_data($args, $opts) function migrate_history_data($args, $opts)
{ {
foreach ($args as $key => $value) { foreach ($args as $key => $value) {
if ($args[$key] === '--include_dyn_content' || $args[$key] === '-i') { if ($args[$key] === '--keep_dyn_content' || $args[$key] === '-i') {
unset($args[$key]); unset($args[$key]);
$opts['include_dyn_content'] = ''; $opts['keep_dyn_content'] = '';
} }
} }
$option = ''; $option = '';
$removedDynContentHistory = true; $removedDynContentHistory = true;
$exist = array_key_exists('include_dyn_content', $opts); $exist = array_key_exists('keep_dyn_content', $opts);
if ($exist) { if ($exist) {
$removedDynContentHistory = false; $removedDynContentHistory = false;
$option = '--include_dyn_content'; $option = '--keep_dyn_content';
} }
if (count($args) === 1) { if (count($args) === 1) {
$start = microtime(true); $start = microtime(true);

View File

@@ -344,10 +344,10 @@ class WorkspaceTools
CLI::logging("<*> Migrating and populating plugin singleton data took " . ($stop - $start) . " seconds.\n"); CLI::logging("<*> Migrating and populating plugin singleton data took " . ($stop - $start) . " seconds.\n");
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
$includeDynContent = isset($optionMigrateHistoryData['includeDynContent']) && $optionMigrateHistoryData['includeDynContent'] === true; $keepDynContent = isset($optionMigrateHistoryData['keepDynContent']) && $optionMigrateHistoryData['keepDynContent'] === true;
$start = microtime(true); $start = microtime(true);
CLI::logging("> Migrating history data...\n"); CLI::logging("> Migrating history data...\n");
$this->migrateAppHistoryToAppDataChangeLog(false, !$includeDynContent); $this->migrateAppHistoryToAppDataChangeLog(false, !$keepDynContent);
$stop = microtime(true); $stop = microtime(true);
CLI::logging("<*> Migrating history data took " . ($stop - $start) . " seconds.\n"); CLI::logging("<*> Migrating history data took " . ($stop - $start) . " seconds.\n");
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
@@ -2067,10 +2067,10 @@ class WorkspaceTools
passthru(PHP_BINARY . ' processmaker regenerate-pmtable-classes ' . $workspace->name); passthru(PHP_BINARY . ' processmaker regenerate-pmtable-classes ' . $workspace->name);
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
$includeDynContent = isset($optionMigrateHistoryData['includeDynContent']) && $optionMigrateHistoryData['includeDynContent'] === true; $keepDynContent = isset($optionMigrateHistoryData['keepDynContent']) && $optionMigrateHistoryData['keepDynContent'] === true;
$start = microtime(true); $start = microtime(true);
CLI::logging("> Migrating history data...\n"); CLI::logging("> Migrating history data...\n");
$workspace->migrateAppHistoryToAppDataChangeLog(false, !$includeDynContent); $workspace->migrateAppHistoryToAppDataChangeLog(false, !$keepDynContent);
$stop = microtime(true); $stop = microtime(true);
CLI::logging("<*> Migrating history data took " . ($stop - $start) . " seconds.\n"); CLI::logging("<*> Migrating history data took " . ($stop - $start) . " seconds.\n");
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/