CleanTalk APBCT `Cron` class

Maintainers

Package info

github.com/CleanTalk/_cron

pkg:composer/cleantalk/cron

Statistics

Installs: 474

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

1.5.1 2026-03-20 13:44 UTC

This package is auto-updated.

Last update: 2026-03-20 13:45:24 UTC


README

Install:

composer require cleantalk/cron

Using:

<?php

$cron = new $cron_class();
$cron_option = \Drupal::state()->get($cron->getCronOptionName());
if (empty($cron_option)) {
$cron->saveTasks($cron->getDefaultTasks());
}
$tasks_to_run = $cron->checkTasks(); // Check for current tasks. Drop tasks inner counters.

if (
! empty( $tasks_to_run ) && // There is tasks to run
! $rc_class::check() && // Do not doing CRON in remote call action
(
! defined( 'DOING_CRON' ) ||
( defined( 'DOING_CRON' ) && DOING_CRON !== true )
)
){
$cron_res = $cron->runTasks( $tasks_to_run );
// Handle the $cron_res for errors here.
}