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 | 60 | 'graphdailyperform', |
| 61 | 61 | null, |
| 62 | 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 | 72 | { |
| 68 | 73 | $this->em = $this->getApplication()->getKernel()->getContainer()->get('doctrine')->getManager(); |
| 69 | 74 | |
| 75 | + $return = null; | |
| 76 | + | |
| 70 | 77 | if ($input->getOption('monitor')) { |
| 71 | 78 | $return = $this->performTask('monitor'); |
| 72 | 79 | } |
| ... | ... | @@ -91,6 +98,9 @@ class CronCommand extends Command |
| 91 | 98 | elseif($input->getOption('graphdailyperform')) { |
| 92 | 99 | $return = $this->performTask('graphdailyperform'); |
| 93 | 100 | } |
| 101 | + elseif($input->getOption('printer')) { | |
| 102 | + $return = $this->performTask('printer'); | |
| 103 | + } | |
| 94 | 104 | |
| 95 | 105 | $output->writeln($return); |
| 96 | 106 | } |
| ... | ... | @@ -102,8 +112,7 @@ class CronCommand extends Command |
| 102 | 112 | $r = file_get_contents($this->getApplication()->getKernel()->getContainer()->get('router') |
| 103 | 113 | ->generate("cocar_$task", array(), true)); |
| 104 | 114 | |
| 105 | - echo $r;die; | |
| 106 | - | |
| 115 | + /* | |
| 107 | 116 | if($task == 'monitor') |
| 108 | 117 | file_get_contents("http://localhost/projeto-cocar/web/app_dev.php/cocar/monitor"); |
| 109 | 118 | elseif($task == 'status') |
| ... | ... | @@ -120,6 +129,9 @@ class CronCommand extends Command |
| 120 | 129 | file_get_contents("http://localhost/projeto-cocar/web/app_dev.php/cocar/endalarm"); |
| 121 | 130 | elseif($task == 'graphdailyperform') |
| 122 | 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 | 136 | catch(Exception $e) |
| 125 | 137 | { | ... | ... |
Controller/PrinterController.php
| ... | ... | @@ -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 | 332 | * @Template() |
| 333 | 333 | */ |
| 334 | 334 | public function totalizerAction() | ... | ... |