diff --git a/workflow/engine/bin/tasks/cliWorkspaces.php b/workflow/engine/bin/tasks/cliWorkspaces.php index cad456482..679df207d 100644 --- a/workflow/engine/bin/tasks/cliWorkspaces.php +++ b/workflow/engine/bin/tasks/cliWorkspaces.php @@ -298,6 +298,7 @@ CLI::taskDescription(<<name); + } + } +} +/** + * This function is executed only by one workspace + * @param array $args, workspaceName for to apply the migrate-content + * @param array $opts, specify the language + * + * @return void +*/ +function migrate_content($args, $opts) +{ G::LoadSystem('inputfilter'); $filter = new InputFilter(); $args = $filter->xssFilterHard($args); $workspaces = get_workspaces_from_args($args); $lang = array_key_exists("lang", $opts) ? $opts['lang'] : SYS_LANG; $start = microtime(true); + //We defined the constants related the workspace + $wsName = $workspaces[key($workspaces)]->name; + Bootstrap::setConstantsRelatedWs($wsName); + //Loop, read all the attributes related to the one workspace CLI::logging("> Optimizing content data...\n"); foreach ($workspaces as $workspace) { - if (!defined('SYS_SYS')) { - define('SYS_SYS', $workspace->name); - } print_r('Regenerating content in: ' . pakeColor::colorize($workspace->name, 'INFO') . "\n"); CLI::logging("-> Regenerating content \n"); $workspace->migrateContentRun($workspace->name, $lang);