TYPO3
7.6
|
Public Member Functions | |
__construct () | |
addTask (Task\AbstractTask $task) | |
executeTask (Task\AbstractTask $task) | |
removeTask (Task\AbstractTask $task) | |
saveTask (Task\AbstractTask $task) | |
fetchTaskRecord ($uid) | |
isValidTaskObject ($task) | |
log ($message, $status=0, $code= 'scheduler') | |
Public Attributes | |
$extConf = array() | |
Protected Member Functions | |
cleanExecutionArrays () | |
getDatabaseConnection () | |
TYPO3 Scheduler. This class handles scheduling and execution of tasks. Formerly known as "Gabriel TYPO3 arch angel"
Definition at line 26 of file Scheduler.php.
__construct | ( | ) |
Constructor, makes sure all derived client classes are included
Definition at line 38 of file Scheduler.php.
References $GLOBALS, and Scheduler\cleanExecutionArrays().
addTask | ( | Task\AbstractTask | $task | ) |
Adds a task to the pool
Task\AbstractTask | $task | The object representing the task to add |
Definition at line 58 of file Scheduler.php.
References $GLOBALS, and Scheduler\getDatabaseConnection().
|
protected |
Cleans the execution lists of the scheduled tasks, executions older than 24h are removed
Definition at line 89 of file Scheduler.php.
References $GLOBALS, and Scheduler\getDatabaseConnection().
Referenced by Scheduler\__construct().
executeTask | ( | Task\AbstractTask | $task | ) |
This method executes the given task and properly marks and records that execution It is expected to return FALSE if the task was barred from running or if it was not saved properly
Task\AbstractTask | $task | The task to execute |
FailedExecutionException | |
\Exception |
Definition at line 133 of file Scheduler.php.
fetchTaskRecord | ( | $uid | ) |
This method is used to get the database record for a given task It returns the database record and not the task object
int | $uid | Primary key of the task to get |
\OutOfBoundsException |
Definition at line 324 of file Scheduler.php.
|
protected |
Definition at line 474 of file Scheduler.php.
References $GLOBALS.
Referenced by Scheduler\addTask(), and Scheduler\cleanExecutionArrays().
isValidTaskObject | ( | $task | ) |
This method encapsulates a very simple test for the purpose of clarity. Registered tasks are stored in the database along with a serialized task object. When a registered task is fetched, its object is unserialized. At that point, if the class corresponding to the object is not available anymore (e.g. because the extension providing it has been uninstalled), the unserialization will produce an incomplete object. This test checks whether the unserialized object is of the right (parent) class or not.
object | $task | The object to test |
Definition at line 388 of file Scheduler.php.
log | ( | $message, | |
$status = 0 , |
|||
$code = 'scheduler' |
|||
) |
This is a utility method that writes some message to the BE Log It could be expanded to write to some other log
string | $message | The message to write to the log |
int | $status | Status (0 = message, 1 = error) |
mixed | $code | Key for the message |
Definition at line 402 of file Scheduler.php.
removeTask | ( | Task\AbstractTask | $task | ) |
Removes a task completely from the system.
Task\AbstractTask | $task | The object representing the task to delete |
Definition at line 209 of file Scheduler.php.
saveTask | ( | Task\AbstractTask | $task | ) |
Updates a task in the pool
Task\AbstractTask | $task | Scheduler task object |
Definition at line 229 of file Scheduler.php.
$extConf = array() |
Definition at line 31 of file Scheduler.php.