Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
Fonctions membres publiques | |
injectLazyJS (EventInterface $event) | |
runLazyCron (EventInterface $e) | |
runWebCron (Event $event) | |
runTestCron (Event $event) | |
Fonctions membres publiques hérités de CMSPlugin | |
__construct (&$subject, $config=array()) | |
loadLanguage ($extension='', $basePath=JPATH_ADMINISTRATOR) | |
setApplication (CMSApplicationInterface $application) | |
Fonctions membres publiques hérités de DispatcherAwareInterface | |
setDispatcher (DispatcherInterface $dispatcher) | |
Fonctions membres publiques hérités de PluginInterface | |
registerListeners () | |
Fonctions membres publiques statiques | |
static | getSubscribedEvents () |
Fonctions membres protégées | |
runScheduler (int $id=0) | |
Fonctions membres protégées hérités de CMSPlugin | |
registerLegacyListener (string $methodName) | |
registerListener (string $methodName) | |
getApplication () | |
Attributs protégés | |
$app | |
Attributs protégés hérités de CMSPlugin | |
$_name = null | |
$_type = null | |
$autoloadLanguage = false | |
$allowLegacyListeners = true | |
Attributs privés | |
const | WEBCRON_KEY_LENGTH = 20 |
Membres hérités additionnels | |
Champs de données hérités de CMSPlugin | |
$params = null | |
This plugin implements listeners to support a visitor-triggered lazy-scheduling pattern. If com_scheduler
is installed/enabled and its configuration allows unprotected lazy scheduling, this plugin injects into each response with an HTML context a JS file {
com_ajax
component. Also supports the scheduler component configuration form through auto-generation of the webcron key and injection of JS of usability enhancement.
|
static |
Exception |
Implémente SubscriberInterface.
Références $app, $config, elseif, et Factory\getApplication().
injectLazyJS | ( | EventInterface | $event | ) |
runLazyCron | ( | EventInterface | $e | ) |
Acts on the LazyCron trigger from the frontend when Lazy Cron is enabled in the Scheduler component configuration. The lazy cron trigger is implemented in client-side JavaScript which is injected on every page load with an HTML context when the component configuration allows it. This method then triggers the Scheduler, which effectively runs the next Task in the Scheduler's task queue.
EventInterface | $e | The onAjaxRunSchedulerLazy event. |
Exception |
Références $config.
|
protected |
Run the scheduler, allowing execution of a single due task. Does not bypass task scheduling, meaning that even if an ID is passed the task is only triggered if it is due.
integer | $id | The optional ID of the task to run |
RuntimeException |
Références $id.
runTestCron | ( | Event | $event | ) |
This method is responsible for the "test run" functionality in the Scheduler administrator backend interface. Acting on a com_ajax
call, this method requires the URL to have a id
query parameter (corresponding to an existing Task ID).
Event | $event | The onAjaxRunScheduler event. |
Exception |
?: About allow simultaneous, how do we detect if it failed because of pre-existing lock?
We will allow CLI exclusive tasks to be fetched and executed, it's left to routines to do a runtime check if they want to refuse normal operation.
Placeholder result, but the idea is if we failed to fetch the task, it's likely because another task was already running. This is a fair assumption if this test run was triggered through the administrator backend, so we know the task probably exists and is either enabled/disabled (not trashed).
Références $id, $task, $user, Event\addArgument(), Joomla\Application\checkToken(), et Factory\getApplication().
runWebCron | ( | Event | $event | ) |
This method is responsible for the WebCron functionality of the Scheduler component.
Acting on a com_ajax
call, this method can work in two ways:
URL query parameters:
hash
string (required) Webcron hash (from the Scheduler component configuration).id
int (optional) ID of the task to trigger.Event | $event | The onAjaxRunSchedulerWebcron event. |
Exception |
|
protected |
|
private |