Commit b5d14582c46cc61ff31733d8770e1eb7892b76e9
1 parent
d7186fd3
Exists in
master
and in
2 other branches
Corrige command
Showing
2 changed files
with
15 additions
and
3 deletions
Show diff stats
Command/CronCommand.php
| @@ -60,6 +60,11 @@ class CronCommand extends Command | @@ -60,6 +60,11 @@ class CronCommand extends Command | ||
| 60 | 'graphdailyperform', | 60 | 'graphdailyperform', |
| 61 | null, | 61 | null, |
| 62 | InputOption::VALUE_NONE | 62 | InputOption::VALUE_NONE |
| 63 | + ) | ||
| 64 | + ->addOption( | ||
| 65 | + 'printer', | ||
| 66 | + null, | ||
| 67 | + InputOption::VALUE_NONE | ||
| 63 | ); | 68 | ); |
| 64 | } | 69 | } |
| 65 | 70 | ||
| @@ -67,6 +72,8 @@ class CronCommand extends Command | @@ -67,6 +72,8 @@ class CronCommand extends Command | ||
| 67 | { | 72 | { |
| 68 | $this->em = $this->getApplication()->getKernel()->getContainer()->get('doctrine')->getManager(); | 73 | $this->em = $this->getApplication()->getKernel()->getContainer()->get('doctrine')->getManager(); |
| 69 | 74 | ||
| 75 | + $return = null; | ||
| 76 | + | ||
| 70 | if ($input->getOption('monitor')) { | 77 | if ($input->getOption('monitor')) { |
| 71 | $return = $this->performTask('monitor'); | 78 | $return = $this->performTask('monitor'); |
| 72 | } | 79 | } |
| @@ -91,6 +98,9 @@ class CronCommand extends Command | @@ -91,6 +98,9 @@ class CronCommand extends Command | ||
| 91 | elseif($input->getOption('graphdailyperform')) { | 98 | elseif($input->getOption('graphdailyperform')) { |
| 92 | $return = $this->performTask('graphdailyperform'); | 99 | $return = $this->performTask('graphdailyperform'); |
| 93 | } | 100 | } |
| 101 | + elseif($input->getOption('printer')) { | ||
| 102 | + $return = $this->performTask('printer'); | ||
| 103 | + } | ||
| 94 | 104 | ||
| 95 | $output->writeln($return); | 105 | $output->writeln($return); |
| 96 | } | 106 | } |
| @@ -102,8 +112,7 @@ class CronCommand extends Command | @@ -102,8 +112,7 @@ class CronCommand extends Command | ||
| 102 | $r = file_get_contents($this->getApplication()->getKernel()->getContainer()->get('router') | 112 | $r = file_get_contents($this->getApplication()->getKernel()->getContainer()->get('router') |
| 103 | ->generate("cocar_$task", array(), true)); | 113 | ->generate("cocar_$task", array(), true)); |
| 104 | 114 | ||
| 105 | - echo $r;die; | ||
| 106 | - | 115 | + /* |
| 107 | if($task == 'monitor') | 116 | if($task == 'monitor') |
| 108 | file_get_contents("http://localhost/projeto-cocar/web/app_dev.php/cocar/monitor"); | 117 | file_get_contents("http://localhost/projeto-cocar/web/app_dev.php/cocar/monitor"); |
| 109 | elseif($task == 'status') | 118 | elseif($task == 'status') |
| @@ -120,6 +129,9 @@ class CronCommand extends Command | @@ -120,6 +129,9 @@ class CronCommand extends Command | ||
| 120 | file_get_contents("http://localhost/projeto-cocar/web/app_dev.php/cocar/endalarm"); | 129 | file_get_contents("http://localhost/projeto-cocar/web/app_dev.php/cocar/endalarm"); |
| 121 | elseif($task == 'graphdailyperform') | 130 | elseif($task == 'graphdailyperform') |
| 122 | file_get_contents("http://localhost/projeto-cocar/web/app_dev.php/cocar/graphdailyperform"); | 131 | file_get_contents("http://localhost/projeto-cocar/web/app_dev.php/cocar/graphdailyperform"); |
| 132 | + elseif($task == 'printer') | ||
| 133 | + file_get_contents("http://localhost/projeto-cocar/web/app_dev.php/cocar/totalizer/info"); | ||
| 134 | + */ | ||
| 123 | } | 135 | } |
| 124 | catch(Exception $e) | 136 | catch(Exception $e) |
| 125 | { | 137 | { |
Controller/PrinterController.php
| @@ -328,7 +328,7 @@ class PrinterController extends Controller | @@ -328,7 +328,7 @@ class PrinterController extends Controller | ||
| 328 | } | 328 | } |
| 329 | 329 | ||
| 330 | /** | 330 | /** |
| 331 | - * @Route("/totalizer/info", name="cocar_totalizer_info") | 331 | + * @Route("/totalizer/info", name="cocar_printer") |
| 332 | * @Template() | 332 | * @Template() |
| 333 | */ | 333 | */ |
| 334 | public function totalizerAction() | 334 | public function totalizerAction() |