浏览代码

Refactory device listener

Guillermo Espinoza 7 年之前
父节点
当前提交
3bb922f8aa
共有 1 个文件被更改,包括 7 次插入3 次删除
  1. 7 3
      EventListener/DeviceListener.php

+ 7 - 3
EventListener/DeviceListener.php

@@ -97,12 +97,16 @@ class DeviceListener
         $application = new Application($kernel);
         $application = new Application($kernel);
         $application->setAutoExit(false);
         $application->setAutoExit(false);
 
 
-        $input = new ArgvInput(array(
+        $args = [
+            '',
             'amqp:remote',
             'amqp:remote',
             $name,
             $name,
-            '--args=' . implode(' --args=', $cmd_args),
             '--route=' . getenv("AMQP_KEY"),
             '--route=' . getenv("AMQP_KEY"),
-        ));
+        ];
+        foreach ($cmd_args as $cmd_arg) {
+            $args[] = '--args=' . $cmd_arg;
+        }
+        $input = new ArgvInput($args);
 
 
         $output = new BufferedOutput();
         $output = new BufferedOutput();