Skip to content

classes_tasks_wdfcrontask.class

Daniel Spors edited this page Dec 19, 2023 · 2 revisions

Classes in file tasks/wdfcrontask.class.php

abstract class WdfCronTask

Entrypoint for a central cron handler. To use this implement your own 'cron' class extenting from WdfCronTask and implement the 'Process' method. It receives the interval in minutes that triggered the current run. Then crontab -e and add a minutley call to the task like this:

cd /your/docroot && php index.php yourcronclassname	

Note that in (difference to cron) this will not run each fill X minutes, but each X minutes. Next run will be scheduled after current run is over, so running a long task hourly will result in more and more shifting away from the complete hour.

Extends: Task

Process

Subclass must implement: Main-Loop

Definition: public abstract function Process($interval)

Returns: void

Parameters:

  • int $interval Interval this loop is called for (1,5,10,15,30,45,60 minutes)

Run

INTERNAL WdfCronTask main loop, creates sub-tasks

RunInternal

INTERNAL WdfCronTask sub-tasks main loop

Status

Prints status about cron tasks.

Definition: public function Status($args)

Returns: void

Parameters:

  • mixed $args Unused

Trigger

Manually triggers cron intervals.

// Syntax: wdfcron-trigger (1|5|10|15|30|45|60)	

Definition: public function Trigger($args)

Returns: void

Parameters:

  • mixed $args CLI args
Clone this wiki locally