Conditions | 1 |
Paths | 1 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
20 | protected function execute(InputInterface $input, OutputInterface $output) |
||
21 | { |
||
22 | $output->writeln('Measuring internet speed'); |
||
23 | $exec = exec('/usr/local/bin/speedtest-cli --server 6601 --json'); |
||
24 | |||
25 | $json = json_decode($exec, true); |
||
26 | |||
27 | $output->writeln($exec); |
||
28 | |||
29 | $varService = $this->getContainer()->get('vars'); |
||
30 | $varService->set('internet.download', round($json['download'])); |
||
31 | $varService->set('internet.upload', round($json['upload'])); |
||
32 | $varService->set('internet.ping', $json['ping']); |
||
33 | } |
||
34 | } |
||
35 |