From 4249f1b0258ef4b2970ac4307d4ce9a6e8efe90b Mon Sep 17 00:00:00 2001 From: Gergely POLONKAI Date: Sun, 7 Oct 2012 01:49:45 +0200 Subject: [PATCH] Added the send command --- Command/SendCommand.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Command/SendCommand.php diff --git a/Command/SendCommand.php b/Command/SendCommand.php new file mode 100644 index 0000000..1290164 --- /dev/null +++ b/Command/SendCommand.php @@ -0,0 +1,31 @@ +setName('gergelypolonkai:smssender:send') + ->addArgument('recipient', InputArgument::REQUIRED) + ->addArgument('message', InputArgument::REQUIRED); + } + + protected function execute(InputInterface $input, OutputInterface $output) { + $container = $this->getContainer(); + + $sender = $container->get('gergelypolonkai_smssender.sender'); + $sender->login( + $container->getParameter('username'), + $container->getParameter('password') + ); + $sender->sendMessage($input->getArgument('recipient'), $input->getArgument('message'), array()); + $sender->logout(); + } +} +