Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
Fonctions | |
startRoutine (ExecuteTaskEvent $event) | |
endRoutine (ExecuteTaskEvent $event, int $exitCode) | |
advertiseRoutines (EventInterface $event) | |
getRoutineId (Form $form, $data) | |
logTask (string $message, string $priority='info') | |
standardRoutineHandler (ExecuteTaskEvent $event) | |
Variables | |
trait | TaskPluginTrait |
Joomla\Component\Scheduler\Administrator\Traits\advertiseRoutines | ( | EventInterface | $event | ) |
Advertise the task routines supported by the plugin. This method should be mapped to the onTaskOptionsList
, enabling the plugin to advertise its routines without any custom logic.
Note: This method expects the TASKS_MAP
class constant to have relevant information.
EventInterface | $event | onTaskOptionsList Event |
Références $options, $subject, et EventInterface\getArgument().
|
protected |
Set information to {
ExecuteTaskEvent | $event | The event |
?int | $exitCode The task exit code |
Références $this, Status\OK, et ExecuteTaskEvent\setResult().
Référencé par SiteStatus\alterSiteStatus(), et Joomla\Component\Scheduler\Administrator\Traits\standardRoutineHandler().
|
protected |
Get the relevant task routine ID in the context of a form event, e.g., the onContentPrepareForm
event.
Form | $form | The form |
mixed | $data | The data |
Références $app, $data, $form, Factory\getApplication(), et ArrayHelper\getValue().
|
protected |
Add a log message to the task log.
string | $message | The log message |
string | $priority | The log message priority |
Références $app, $category, $message, Text\_(), Log\add(), Log\DEBUG, Log\ERROR, Factory\getApplication(), Log\INFO, JPATH_ADMINISTRATOR, Log\NOTICE, et Log\WARNING.
Référencé par SiteStatus\alterSiteStatus(), Checkfiles\checkImages(), Requests\makeGetRequest(), DemoTasks\sleep(), Joomla\Component\Scheduler\Administrator\Traits\standardRoutineHandler(), DemoTasks\stressMemory(), DemoTasks\stressMemoryRemoveLimit(), et SiteStatus\writeConfigFile().
Joomla\Component\Scheduler\Administrator\Traits\standardRoutineHandler | ( | ExecuteTaskEvent | $event | ) |
Handler for standard task routines. Standard routines are mapped to valid class methods 'method' through static::TASKS_MAP
. These methods are expected to take a single argument (the Event) and return an integer return status (see {
onExecuteTask
event through {ExecuteTaskEvent | $event | The onExecuteTask event. |
Closure to validate a status against {
Références $method, $methodName, Symfony\Component\Console\Tester\$statusCode, $this, class, Joomla\Component\Scheduler\Administrator\Traits\endRoutine(), ExecuteTaskEvent\getRoutineId(), Status\INVALID_EXIT, Joomla\Component\Scheduler\Administrator\Traits\logTask(), Status\NO_EXIT, Status\NO_RUN, et Joomla\Component\Scheduler\Administrator\Traits\startRoutine().
|
protected |
Set information to {
ExecuteTaskEvent | $event | The onExecuteTask event. |
Références $this, AbstractEvent\getArgument(), et Status\RUNNING.
Référencé par SiteStatus\alterSiteStatus(), et Joomla\Component\Scheduler\Administrator\Traits\standardRoutineHandler().
trait TaskPluginTrait |
Utility trait for plugins that offer com_scheduler
compatible task routines. This trait defines a lot of handy methods that make it really simple to support task routines in a J4.x plugin. This trait includes standard methods to broadcast routines {
TASKS_MAP
class constant to declare supported routines and related properties.