コード例 #1
0
ファイル: Scheduler.php プロジェクト: rickymathew/TYPO3.CMS
 /**
  * Updates a task in the pool
  *
  * @param Task\AbstractTask $task Scheduler task object
  * @return bool False if submitted task was not of proper class
  */
 public function saveTask(Task\AbstractTask $task)
 {
     $taskUid = $task->getTaskUid();
     if (!empty($taskUid)) {
         try {
             $executionTime = $task->getNextDueExecution();
             $task->setExecutionTime($executionTime);
         } catch (\Exception $e) {
             $task->setDisabled(true);
             $executionTime = 0;
         }
         $task->unsetScheduler();
         $fields = array('nextexecution' => $executionTime, 'disable' => $task->isDisabled(), 'description' => $task->getDescription(), 'task_group' => $task->getTaskGroup(), 'serialized_task_object' => serialize($task));
         $result = $this->getDatabaseConnection()->exec_UPDATEquery('tx_scheduler_task', 'uid = ' . $taskUid, $fields);
     } else {
         $result = false;
     }
     if ($result) {
         $this->scheduleNextSchedulerRunUsingAtDaemon();
     }
     return $result;
 }
コード例 #2
0
ファイル: Scheduler.php プロジェクト: nicksergio/TYPO3v4-Core
 /**
  * Updates a task in the pool
  *
  * @param \TYPO3\CMS\Scheduler\Task\AbstractTask $task Scheduler task object
  * @return boolean False if submitted task was not of proper class
  */
 public function saveTask(\TYPO3\CMS\Scheduler\Task\AbstractTask $task)
 {
     $taskUid = $task->getTaskUid();
     if (!empty($taskUid)) {
         try {
             $executionTime = $task->getNextDueExecution();
             $task->setExecutionTime($executionTime);
         } catch (\Exception $e) {
             $task->setDisabled(TRUE);
             $executionTime = 0;
         }
         $task->unsetScheduler();
         $fields = array('nextexecution' => $executionTime, 'disable' => $task->isDisabled(), 'serialized_task_object' => serialize($task));
         $result = $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_scheduler_task', 'uid = ' . $taskUid, $fields);
     } else {
         $result = FALSE;
     }
     if ($result) {
         $this->scheduleNextSchedulerRunUsingAtDaemon();
     }
     return $result;
 }