diff --git a/console.php b/console.php index 9a2f012cb3..3a6739f2c4 100755 --- a/console.php +++ b/console.php @@ -77,6 +77,7 @@ $cli->addCommands( new ChamiloLMS\Command\Template\AsseticDumpCommand(), new ChamiloLMS\Command\Transaction\ImportToSystemCommand(), + new ChamiloLMS\Command\Transaction\ReceiveCommand(), new ChamiloLMS\Command\Transaction\SendCommand(), new ChamiloLMS\Command\Transaction\MineduSendCommand(), new ChamiloLMS\Command\Translation\ExportLanguagesCommand(), diff --git a/src/ChamiloLMS/Command/Transaction/ReceiveCommand.php b/src/ChamiloLMS/Command/Transaction/ReceiveCommand.php new file mode 100644 index 0000000000..443726c0a6 --- /dev/null +++ b/src/ChamiloLMS/Command/Transaction/ReceiveCommand.php @@ -0,0 +1,31 @@ +setName('tx:receive') + ->setDescription('Runs local branch associated receive plugin processing envelope reception.') + ->addOption('limit', null, InputOption::VALUE_OPTIONAL, 'The maximum number of envelopes to receive in this operation.', 1); + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $tc = new TransactionLogController(); + $limit = (int) $input->getOption('limit'); + if ($limit <= 0) { + $limit = 1; + } + $envelopes = $tc->receiveEnvelopeData($limit); + $output->writeln(sprintf('Correctly received (%d) envelopes now added to the queue.', count($envelopes))); + } +}