Fixing conflict with PMC-852

This commit is contained in:
Julio Cesar Laura Avendaño
2019-07-22 12:05:21 -04:00
38 changed files with 3956 additions and 17 deletions

View File

@@ -1,5 +1,6 @@
<?php
use ProcessMaker\Core\JobsManager;
use ProcessMaker\Model\Process;
use ProcessMaker\Validation\MySQL57;
@@ -370,6 +371,21 @@ CLI::taskArg("workspace-name", true, true);
CLI::taskRun("run_check_queries_incompatibilities");
/*********************************************************************/
/**
* This command executes "artisan" loading the workspace connection parameters
*/
CLI::taskName('artisan');
CLI::taskDescription(<<<EOT
This command executes "artisan" loading the workspace parameters.
Example:
./processmaker artisan queue:work --workspace=workflow
To see other command options please refer to the artisan help.
php artisan --help
EOT
);
CLI::taskRun("run_artisan");
/**
* Function run_info
*
@@ -1378,3 +1394,32 @@ function check_queries_incompatibilities($wsName)
echo ">> No MySQL 5.7 incompatibilities in variables found for this workspace." . PHP_EOL;
}
}
/**
* This function obtains the connection parameters and passes them to the artisan.
* All artisan options can be applied. For more information on artisan options use
* php artisan --help
* @param array $args
*/
function run_artisan($args)
{
$jobsManager = JobsManager::getSingleton()->init();
$workspace = $jobsManager->getOptionValueFromArguments($args, "--workspace");
if ($workspace !== false) {
config(['system.workspace' => $workspace]);
$sw = in_array($args[0], ['queue:work', 'queue:listen']);
$tries = $jobsManager->getOptionValueFromArguments($args, "--tries");
if ($sw === true && $tries === false) {
$tries = $jobsManager->getTries();
array_push($args, "--tries={$tries}");
}
array_push($args, "--processmakerPath=" . PROCESSMAKER_PATH);
$command = "artisan " . implode(" ", $args);
CLI::logging("> {$command}\n");
passthru(PHP_BINARY . " {$command}");
} else {
CLI::logging("> The --workspace option is undefined.\n");
}
}