|
@@ 104-122 (lines=19) @@
|
| 101 |
|
* @param $id - the line of the cron in the cron table |
| 102 |
|
* @return \Symfony\Component\HttpFoundation\RedirectResponse |
| 103 |
|
*/ |
| 104 |
|
public function wakeupAction($id) |
| 105 |
|
{ |
| 106 |
|
$cronManager = new CronManager(); |
| 107 |
|
$cronList = $cronManager->get(); |
| 108 |
|
$this->addFlash('message', $cronManager->getOutput()); |
| 109 |
|
$this->addFlash('error', $cronManager->getError()); |
| 110 |
|
|
| 111 |
|
/** |
| 112 |
|
* @var \FOA\CronBundle\Manager\Cron $cron |
| 113 |
|
*/ |
| 114 |
|
$cron = $cronList[$id]; |
| 115 |
|
$cron->setSuspended(false); |
| 116 |
|
|
| 117 |
|
$cronManager->write(); |
| 118 |
|
$this->addFlash('message', $cronManager->getOutput()); |
| 119 |
|
$this->addFlash('error', $cronManager->getError()); |
| 120 |
|
|
| 121 |
|
return $this->redirect($this->generateUrl('BCCCronManagerBundle_index')); |
| 122 |
|
} |
| 123 |
|
|
| 124 |
|
/** |
| 125 |
|
* Suspend a cron from the cron table |
|
@@ 130-148 (lines=19) @@
|
| 127 |
|
* @param $id - the line of the cron in the cron table |
| 128 |
|
* @return \Symfony\Component\HttpFoundation\RedirectResponse |
| 129 |
|
*/ |
| 130 |
|
public function suspendAction($id) |
| 131 |
|
{ |
| 132 |
|
$cronManager = new CronManager(); |
| 133 |
|
$cronList = $cronManager->get(); |
| 134 |
|
$this->addFlash('message', $cronManager->getOutput()); |
| 135 |
|
$this->addFlash('error', $cronManager->getError()); |
| 136 |
|
|
| 137 |
|
/** |
| 138 |
|
* @var \FOA\CronBundle\Manager\Cron $cron |
| 139 |
|
*/ |
| 140 |
|
$cron = $cronList[$id]; |
| 141 |
|
$cron->setSuspended(true); |
| 142 |
|
|
| 143 |
|
$cronManager->write(); |
| 144 |
|
$this->addFlash('message', $cronManager->getOutput()); |
| 145 |
|
$this->addFlash('error', $cronManager->getError()); |
| 146 |
|
|
| 147 |
|
return $this->redirect($this->generateUrl('BCCCronManagerBundle_index')); |
| 148 |
|
} |
| 149 |
|
|
| 150 |
|
/** |
| 151 |
|
* Remove a cron from the cron table |