92 abstract public function execute();
113 $this->taskUid = (int)$id;
131 return $GLOBALS[
'LANG']->sL(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'scheduler'][
'tasks'][get_class($this)][
'title']);
140 return $GLOBALS[
'LANG']->sL(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'scheduler'][
'tasks'][get_class($this)][
'description']);
149 return get_class($this);
169 $this->disabled = TRUE;
171 $this->disabled = FALSE;
182 $this->executionTime = (int)$timestamp;
249 unset($this->scheduler);
257 public function registerSingleExecution($timestamp) {
280 public function registerRecurringExecution($start, $interval, $end = 0, $multiple = FALSE, $cron_cmd =
'') {
287 if (empty($cron_cmd)) {
325 return $this->execution->getNextExecution();
334 return $this->execution->getMultiple();
345 'SELECT' =>
'serialized_executions',
346 'FROM' =>
'tx_scheduler_task',
347 'WHERE' =>
'uid = ' . $this->taskUid,
350 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECT_queryArray($queryArr);
351 if ($row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res)) {
352 if (strlen($row[
'serialized_executions']) > 0) {
356 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
368 'SELECT' =>
'serialized_executions',
369 'FROM' =>
'tx_scheduler_task',
370 'WHERE' =>
'uid = ' . $this->taskUid,
373 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECT_queryArray($queryArr);
374 $runningExecutions = array();
375 if ($row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res)) {
376 if (strlen($row[
'serialized_executions']) > 0) {
377 $runningExecutions = unserialize($row[
'serialized_executions']);
380 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
383 $numExecutions = count($runningExecutions);
384 $runningExecutions[$numExecutions] = time();
387 if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI) {
390 $GLOBALS[
'TYPO3_DB']->exec_UPDATEquery(
'tx_scheduler_task',
'uid = ' . $this->taskUid, array(
391 'serialized_executions' => serialize($runningExecutions),
392 'lastexecution_time' => time(),
393 'lastexecution_context' => $context
395 return $numExecutions;
408 'SELECT' =>
'serialized_executions',
409 'FROM' =>
'tx_scheduler_task',
410 'WHERE' =>
'uid = ' . $this->taskUid,
413 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECT_queryArray($queryArr);
414 if ($row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res)) {
415 if (strlen($row[
'serialized_executions']) > 0) {
416 $runningExecutions = unserialize($row[
'serialized_executions']);
418 unset($runningExecutions[$executionID]);
419 if (count($runningExecutions) > 0) {
421 $runningExecutionsSerialized = serialize($runningExecutions);
423 $runningExecutionsSerialized =
'';
425 if ($failure instanceof \Exception) {
427 $logMessage =
'Task failed to execute successfully. Class: ' . get_class($this) .
', UID: ' . $this->taskUid .
'. ' . $failure->getMessage();
428 $this->scheduler->log($logMessage, 1, $failure->getCode());
430 $failureString = serialize(array(
431 'code' => $failure->getCode(),
432 'message' => $failure->getMessage(),
433 'file' => $failure->getFile(),
434 'line' => $failure->getLine(),
435 'traceString' => $failure->getTraceAsString(),
441 $GLOBALS[
'TYPO3_DB']->exec_UPDATEquery(
'tx_scheduler_task',
'uid = ' . $this->taskUid, array(
442 'serialized_executions' => $runningExecutionsSerialized,
443 'lastexecution_failure' => $failureString
447 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
457 $result =
$GLOBALS[
'TYPO3_DB']->exec_UPDATEquery(
'tx_scheduler_task',
'uid = ' . $this->taskUid, array(
458 'serialized_executions' =>
'' 469 return $this->scheduler->saveTask($this);
487 public function remove() {
488 $this->scheduler->removeTask($this);
setExecutionTime($timestamp)
setDescription($description)
getAdditionalInformation()
unmarkExecution($executionID, \Exception $failure=NULL)
static makeInstance($className)
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren't numeric.
areMultipleExecutionsAllowed()
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
setExecution(\TYPO3\CMS\Scheduler\Execution $execution)