Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de la classe PlgSystemSchedulerunner
+ Graphe d'héritage de PlgSystemSchedulerunner:

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
 

Description détaillée

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 {

Voir également
PlgSystemSchedulerunner::injectScheduleRunner()} that sets up an AJAX callback to trigger the scheduler {
PlgSystemSchedulerunner::runScheduler()}. This is achieved through a call to the com_ajax component. Also supports the scheduler component configuration form through auto-generation of the webcron key and injection of JS of usability enhancement.
Depuis
4.1.0

Documentation des fonctions membres

◆ getSubscribedEvents()

static getSubscribedEvents ( )
static
Renvoie
string[]
Depuis
4.1.0
Exceptions
Exception

Implémente SubscriberInterface.

Références $app, $config, elseif, et Factory\getApplication().

◆ injectLazyJS()

injectLazyJS ( EventInterface  $event)

Inject JavaScript to trigger the scheduler in HTML contexts.

Paramètres
EventInterface$eventThe onBeforeCompileHead event.
Renvoie
void
Depuis
4.1.0

Références $config, $items, $model, et $wa.

◆ runLazyCron()

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.

Paramètres
EventInterface$eThe onAjaxRunSchedulerLazy event.
Renvoie
void
Depuis
4.1.0
Exceptions
Exception

Références $config.

◆ runScheduler()

runScheduler ( int  $id = 0)
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.

Paramètres
integer$idThe optional ID of the task to run
Renvoie
?Task
Depuis
4.1.0
Exceptions
RuntimeException

Références $id.

◆ runTestCron()

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).

Paramètres
Event$eventThe onAjaxRunScheduler event.
Renvoie
void
Depuis
4.1.0
Exceptions
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()

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:

  1. If no Task ID is specified, it triggers the Scheduler to run the next task in the task queue.
  2. If a Task ID is specified, it fetches the task (if it exists) from the Scheduler API and executes it.

URL query parameters:

  • hash string (required) Webcron hash (from the Scheduler component configuration).
  • id int (optional) ID of the task to trigger.
Paramètres
Event$eventThe onAjaxRunSchedulerWebcron event.
Renvoie
void
Depuis
4.1.0
Exceptions
Exception

Références $config, $hash, $id, et $task.

Documentation des champs

◆ $app

$app
protected

◆ WEBCRON_KEY_LENGTH

const WEBCRON_KEY_LENGTH = 20
private

La documentation de cette classe a été générée à partir du fichier suivant :