|
@@ -34,6 +34,7 @@ class CommandConsumer implements ConsumerInterface
|
|
public function execute(AMQPMessage $msg)
|
|
public function execute(AMQPMessage $msg)
|
|
{
|
|
{
|
|
$msgBody = unserialize($msg->body);
|
|
$msgBody = unserialize($msg->body);
|
|
|
|
+
|
|
if (isset($msgBody['name']) && isset($msgBody['args'])) {
|
|
if (isset($msgBody['name']) && isset($msgBody['args'])) {
|
|
// command name and args
|
|
// command name and args
|
|
$name = $msgBody['name'];
|
|
$name = $msgBody['name'];
|
|
@@ -52,12 +53,17 @@ class CommandConsumer implements ConsumerInterface
|
|
$input[] = preg_replace('/:/', '=', $arg, 1);
|
|
$input[] = preg_replace('/:/', '=', $arg, 1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- $consolePath = $this->serviceContainer->get('kernel')->getRootDir() . '/../bin/console';
|
|
|
|
- $command = $name . ' ' . implode(' ', $input);
|
|
|
|
|
|
+
|
|
|
|
+ if(in_array("--executeName",$input)) {
|
|
|
|
+ $execute = $name;
|
|
|
|
+ } else {
|
|
|
|
+ $consolePath = $this->serviceContainer->get('kernel')->getRootDir() . '/../bin/console';
|
|
|
|
+ $command = $name . ' ' . implode(' ', $input);
|
|
|
|
+ $execute = "{$consolePath} {$command}";
|
|
|
|
+ }
|
|
|
|
|
|
try {
|
|
try {
|
|
- $process = new Process("{$consolePath} {$command}");
|
|
|
|
|
|
+ $process = new Process($execute);
|
|
$process->setTimeout(10 * 60);
|
|
$process->setTimeout(10 * 60);
|
|
$process->run();
|
|
$process->run();
|
|
|
|
|