cleantalk / cron
CleanTalk APBCT `Cron` class
1.5.1
2026-03-20 13:44 UTC
Requires
Requires (Dev)
- phpcompatibility/php-compatibility: ^9.3
- phpunit/phpunit: ^7.5
- squizlabs/php_codesniffer: 3.*
- vimeo/psalm: ^4.8
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. }