Conditions | 3 |
Paths | 3 |
Total Lines | 29 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
33 | protected function execute(InputInterface $input, OutputInterface $output) |
||
34 | { |
||
35 | $comodoDecodeCSR = new ComodoDecodeCSR(); |
||
36 | |||
37 | try { |
||
38 | $comodoDecodeCSR->setCSR($this->loadCSR($input, $output)); |
||
39 | } catch (Exception $e) { |
||
40 | $output->writeln('<error>Error!</error>'); |
||
41 | $output->writeln('Invalid CSR'); |
||
42 | |||
43 | return 3; |
||
44 | } |
||
45 | |||
46 | $hashes = $comodoDecodeCSR->fetchHashes(); |
||
47 | |||
48 | if (!$hashes) { |
||
49 | $output->writeln('<error>Fail!</error>'); |
||
50 | $output->writeln('Unable to fetch hashes'); |
||
51 | |||
52 | return 2; |
||
53 | } |
||
54 | |||
55 | $output->writeln('<info>Filename:</info> ' . $hashes['md5'] . '.txt'); |
||
56 | $output->writeln('<info>Contents:</info>'); |
||
57 | $output->writeln($comodoDecodeCSR->generateDVC()); |
||
58 | $output->writeln('<info>URL:</info> http://' . $comodoDecodeCSR->getCN() . '/' . $hashes['md5'] . '.txt'); |
||
59 | |||
60 | return 0; |
||
61 | } |
||
62 | } |
||
63 |