![]() |
CMS
Version 3.9
|
Manages scheduled task registration and execution. More...
Public Member Functions | |
__construct () | |
Creates a ScheduledTaskManager. More... | |
getTasks () | |
Retrieves all the registered scheduled tasks. More... | |
executeTask ($component, $task_name) | |
Executes the specified scheduled task. More... | |
runTasks () | |
Runs all the tasks that are scheduled to be run for the current period (day and hour). More... | |
Static Public Member Functions | |
static | registerScheduledTaskWorkers () |
Registers a simple task that sends an email when triggered. More... | |
static | setDefaults () |
static | registerWorker ($component, $task_name, $handler, $hourly=false) |
Registers a Scheduled Task worker method. More... | |
static | getTabs ($key) |
static | testTask () |
Provides the implementation of the test task, that can be used to validate the scheduled task server configuration (cron job, etc) More... | |
static | upgradeComponent ($version) |
Static Public Attributes | |
static | $workers = array() |
Manages scheduled task registration and execution.
Scheduled tasks are tasks that can be run periodically without user initiation, triggered by a cron job or Windows scheduled task. Components can register tasks by subscribing to the RegisterScheduledTaskWorkers event. Registered tasks can then be configured for scheduled execution via the admin screens.
Definition at line 16 of file scheduled_task_manager.inc.
ScheduledTaskManager::__construct | ( | ) |
Creates a ScheduledTaskManager.
Definition at line 23 of file scheduled_task_manager.inc.
ScheduledTaskManager::executeTask | ( | $component, | |
$task_name | |||
) |
Executes the specified scheduled task.
string | $component | the name of the component that owns the task |
string | $task_name | the name of the task to be executed |
Definition at line 93 of file scheduled_task_manager.inc.
|
static |
Definition at line 71 of file scheduled_task_manager.inc.
ScheduledTaskManager::getTasks | ( | ) |
Retrieves all the registered scheduled tasks.
Definition at line 83 of file scheduled_task_manager.inc.
|
static |
Registers a simple task that sends an email when triggered.
This can be used to validate the configuration of the cron job / scheduled task environment.
Definition at line 32 of file scheduled_task_manager.inc.
|
static |
Registers a Scheduled Task worker method.
This method should be called from within the component's RegisterScheduledTaskWorkers event handler. Components are free to register as many scheduled task workers as they need.
string | $component | the name of the component that owns the worker |
string | $task_name | the display name of the task |
callback | $handler | the handler method to call to execute the task |
boolean | $hourly | true if this task should always be executed every hour, false if the task should be explicitly scheduled by the user |
Definition at line 52 of file scheduled_task_manager.inc.
ScheduledTaskManager::runTasks | ( | ) |
Runs all the tasks that are scheduled to be run for the current period (day and hour).
Definition at line 123 of file scheduled_task_manager.inc.
|
static |
Definition at line 37 of file scheduled_task_manager.inc.
|
static |
Provides the implementation of the test task, that can be used to validate the scheduled task server configuration (cron job, etc)
Definition at line 154 of file scheduled_task_manager.inc.
|
static |
Definition at line 184 of file scheduled_task_manager.inc.
|
static |
Definition at line 18 of file scheduled_task_manager.inc.