Commit b1e539c8a7c485aeab56def04c1cf00e2459f15d

Authored by Eduardo Santos
1 parent 2e2fb435
Exists in master and in 2 other branches 3,1, 3.1

Corrige bug da execução do comando de coleta das impressoras

Showing 1 changed file with 7 additions and 4 deletions   Show diff stats
Command/CronCommand.php
@@ -14,7 +14,7 @@ class CronCommand extends ContainerAwareCommand @@ -14,7 +14,7 @@ class CronCommand extends ContainerAwareCommand
14 * 14 *
15 * @var type object 15 * @var type object
16 */ 16 */
17 - private $em; 17 + //private $em;
18 18
19 protected function configure() 19 protected function configure()
20 { 20 {
@@ -70,7 +70,7 @@ class CronCommand extends ContainerAwareCommand @@ -70,7 +70,7 @@ class CronCommand extends ContainerAwareCommand
70 70
71 protected function execute(InputInterface $input, OutputInterface $output) 71 protected function execute(InputInterface $input, OutputInterface $output)
72 { 72 {
73 - $this->em = $this->getContainer()->get('doctrine')->getManager(); 73 + //$this->em = $this->getContainer()->get('doctrine')->getManager();
74 //$this->getApplication()->getKernel()->getContainer()->get('doctrine')->getManager(); 74 //$this->getApplication()->getKernel()->getContainer()->get('doctrine')->getManager();
75 75
76 $return = null; 76 $return = null;
@@ -130,8 +130,11 @@ class CronCommand extends ContainerAwareCommand @@ -130,8 +130,11 @@ class CronCommand extends ContainerAwareCommand
130 file_get_contents("http://localhost/cocar/web/app_dev.php/cocar/endalarm"); 130 file_get_contents("http://localhost/cocar/web/app_dev.php/cocar/endalarm");
131 elseif($task == 'graphdailyperform') 131 elseif($task == 'graphdailyperform')
132 file_get_contents("http://localhost/cocar/web/app_dev.php/cocar/graphdailyperform"); 132 file_get_contents("http://localhost/cocar/web/app_dev.php/cocar/graphdailyperform");
133 - elseif($task == 'printer')  
134 - $this->getContainer()->get('printer')->totalizer(); 133 + elseif($task == 'printer') {
  134 + $printer_controller = $this->getContainer()->get('printer');
  135 + $printer_controller->setContainer($this->getContainer());
  136 + $printer_controller->totalizer();
  137 + }
135 138
136 } 139 }
137 catch(Exception $e) 140 catch(Exception $e)