Pārlūkot izejas kodu

FD3-223 Fix command args

Guillermo Espinoza 7 gadi atpakaļ
vecāks
revīzija
8a30206efe
2 mainītis faili ar 3 papildinājumiem un 7 dzēšanām
  1. 0 4
      Command/AMQPRemoteCommand.php
  2. 3 3
      Services/CommandConsumer.php

+ 0 - 4
Command/AMQPRemoteCommand.php

@@ -30,10 +30,6 @@ class AMQPRemoteCommand extends ContainerAwareCommand
         $name = $input->getArgument('name');
         $args = $input->getOption('args');
         if ($name) {
-            $msg = array(
-                'name' => $name,
-                'args' => $args,
-            );
             $producer = $this->getContainer()->get('old_sound_rabbit_mq.command_producer_producer');
             $producer->publish(serialize(compact('name', 'args')));
             

+ 3 - 3
Services/CommandConsumer.php

@@ -46,9 +46,9 @@ class CommandConsumer implements ConsumerInterface
 
             $input = array('command' => $name,);
             foreach ($args as $arg) {
-                $pieces = explode(':', $arg);
-                if (isset($pieces[0]) && isset($pieces[1])) {
-                    $input[$pieces[0]] = $pieces[1];
+                $pos = strpos($arg, ':');
+                if ($pos) {
+                    $input[substr($arg, 0, $pos)] = substr($arg, $pos + 1);
                 }
             }