You are here

function ultimate_cron_cron in Ultimate Cron 8.2

Same name and namespace in other branches
  1. 6 ultimate_cron.module \ultimate_cron_cron()

Implements hook_cronapi().

Adds clean up jobs for plugins.

1 call to ultimate_cron_cron()
LoggerPluginTest::testCleanup in tests/src/Kernel/LoggerPluginTest.php
Tests log cleanup of the database logger.
1 string reference to 'ultimate_cron_cron'
CronJobFormTest::testManageJob in tests/src/Functional/CronJobFormTest.php
Tests adding and editing a cron job.

File

./ultimate_cron.module, line 175
Ultimate Cron. Extend cron functionality in Drupal.

Code

function ultimate_cron_cron() {
  $plugin_types = CronPlugin::getPluginTypes();
  foreach ($plugin_types as $plugin_type => $info) {
    foreach (ultimate_cron_plugin_load_all($plugin_type) as $name => $plugin) {
      if ($plugin
        ->isValid() && $plugin instanceof PluginCleanupInterface) {
        $plugin
          ->cleanup();
      }
    }
  }
}