[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/infrastructure/sms/management/ -> PhabricatorSMSManagementSendTestWorkflow.php (source)

   1  <?php
   2  
   3  final class PhabricatorSMSManagementSendTestWorkflow
   4    extends PhabricatorSMSManagementWorkflow {
   5  
   6    protected function didConstruct() {
   7      $this
   8        ->setName('send-test')
   9        ->setSynopsis(
  10          pht(
  11            'Simulate sending an sms. This may be useful to test your sms '.
  12            'configuration, or while developing new sms adapters.'))
  13        ->setExamples(
  14          "**send-test** --to 12345678 --body 'pizza time yet?'")
  15        ->setArguments(
  16          array(
  17            array(
  18              'name'    => 'to',
  19              'param'   => 'number',
  20              'help'    => 'Send sms "To:" the specified number.',
  21              'repeat'  => true,
  22            ),
  23            array(
  24              'name'    => 'body',
  25              'param'   => 'text',
  26              'help'    => 'Send sms with the specified body.',
  27            ),
  28          ));
  29    }
  30  
  31    public function execute(PhutilArgumentParser $args) {
  32      $console = PhutilConsole::getConsole();
  33      $viewer = $this->getViewer();
  34  
  35      $tos = $args->getArg('to');
  36      $body = $args->getArg('body');
  37  
  38      PhabricatorWorker::setRunAllTasksInProcess(true);
  39      PhabricatorSMSImplementationAdapter::sendSMS($tos, $body);
  40  
  41      $console->writeErr(
  42        "%s\n\n    phabricator/ $ ./bin/sms list-outbound \n\n",
  43        pht(
  44          'Send completed! You can view the list of SMS messages sent by '.
  45          'running this command:'));
  46    }
  47  
  48  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1