| Conditions | 2 |
| Paths | 2 |
| Total Lines | 25 |
| Code Lines | 16 |
| Lines | 8 |
| Ratio | 32 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function execute(InputInterface $input, OutputInterface $output) |
||
| 26 | { |
||
| 27 | $client = $this->getContainer()->get('sqs_job_queue.client'); |
||
| 28 | $queue = $input->getArgument('queue'); |
||
| 29 | $result = $client->getQueueUrl(array( |
||
| 30 | 'QueueName' => $queue |
||
| 31 | )); |
||
| 32 | |||
| 33 | $dialog = $this->getHelper('dialog'); |
||
| 34 | $ret = $dialog->askConfirmation( |
||
| 35 | $output, |
||
| 36 | "<question>{$queue} purge queue?[yes or no]</question> ", |
||
| 37 | false |
||
| 38 | ); |
||
| 39 | |||
| 40 | View Code Duplication | if ($ret) { |
|
| 41 | $client->purgeQueue(array( |
||
| 42 | 'QueueUrl' => $result['QueueUrl'] |
||
| 43 | )); |
||
| 44 | $output->writeln('<info>pugrge queue url</info>: '. $result['QueueUrl']); |
||
| 45 | } else { |
||
| 46 | $output->writeln('cancel purge...'); |
||
| 47 | } |
||
| 48 | |||
| 49 | } |
||
| 50 | } |