/** * Executes the current command. * * @param InputInterface $input An InputInterface instance * @param OutputInterface $output An OutputInterface instance * * @return integer 0 if everything went fine, or an error code */ protected function execute(InputInterface $input, OutputInterface $output) { define('AMQP_DEBUG', (bool) $input->getOption('debug')); $producer = $this->registry->getProducer($input->getArgument('name')); $data = ''; while (!feof(STDIN)) { $data .= fread(STDIN, 8192); } $producer->publish(serialize($data)); }