Actions

FIXME Language Alert: Unfortunately this page is still in german, please help by translating it.

Aktionen sind Skripte für regelmäßige Aufgaben. Damit die Aktionen ausgeführt werden, muss ein Cronjob eingerichtet werden, der die Datei cronaction.php im Backend ausführt.

Actions are scripts for regular tasks. In order to execute the actions, you have to create a cronjob that polls the file cronaction.php.

Innerhalb der Skripte stehen die Objekte $myPT und $myDB sowie $myAction zur Verfügung. $myAction verfügt über nachfolgende Methoden:

Within action scripts you can use the objects $myPT and $myDB as well as $myAction. $myAction has following functions:

  • function nextRunAddTime($s)
  • function nextRunSetTime($t)

Mit diesen Methoden wird der nächste Startzeitpunkt einer Aktion festgelegt. Der Methode nextRunAddTime($s) wird eine Pause bis zur nächsten Ausführung in Sekunden übergeben, die Methode nextRunSetTime($t) erwartet einen Unix-Timestamp.

Using these methods you can set the next execution time. While the function nextRunAddTime($s) add a pause (in seconds) until the next execution, the function nextRunSetTime($t) expects a unix timestamp as parameter.

Während der Ausführung einer Action wird diese intern auf “running” gesetzt, so dass eine Aktion nicht mehrfach gleichzeitig ausgeführt werden kann, falls die Ausführung länger als der eingestellte Cronzyklus dauert. Generell wird die Ausführung nach einer Stunde zurückgestellt.

During the execution of an action it is internally set to “running”. This prevents multiple executions of the same action in case the action runs longer than the cron interval. Execution is postponed after an hour.

Achtung Attention

Wird einer Action keine neue Startzeit übergeben, wird sie bei jedem Aufruf von cronaction.php gestartet.
If an action does not get a new start time, it is started for each call of cronaction.php.

You think Phenotype Wiki/Documentation could be better?
We too. Please contribute: Edit this page

Bookmark and Share