Browse Source

Refactory device listener

Guillermo Espinoza 7 năm trước cách đây
mục cha
commit
3bb922f8aa
1 tập tin đã thay đổi với 7 bổ sung3 xóa
  1. 7 3
      EventListener/DeviceListener.php

+ 7 - 3
EventListener/DeviceListener.php

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