This project is not covered by Drupal’s security advisory policy.

Cron API is a module that allows other modules to register their cron based functions and provides an administrator interface so admins can configure when specific cron actions are actually run.

This module is currently under development, so if you find bugs.... please let me know.

The main configurations page is loaded on /admin/settings/cronapi
Currently on initial install there are no sample presets and if you want to play/use this module... you will need to create your own cron based hooks with the following API functions:
These functions are also commented out in cronapi.module

Create a preset:

<?php
/**
 * Example preset definition
 *
 * Implementation of hook_cronapi_preset
 * Allows individual modules to create presets.
 */
function cronapi_cronapi_preset() {
  return array(
    'test_preset'   => t('Test Preset'),
  );
}// end - function
?>

Call a preset (this function will be called from any module that implements this hook):

<?php
/**
 * Example of preset function call
 *
 * Implementation of preset _test_preset hook
 * this is where preset actions should take place.
 *
 * @param $op
 *   String - 'rotate', 'update', 'insert', 'delete'
 * @param $preset
 *   The preset array structure that is being invoked.
 */
function cronapi_test_preset($op = NULL, $preset = NULL) {
  switch ($op) {
    case 'rotate':
    break;
    case 'update':
    break;
    case 'insert':
    break;
    case 'delete':
    break;
    default:
    break;
  }// end - switch
}// end - function
?>

To make adjustments before cron functions are ran:

<?php
/** 
 * Example preset admustments
 *
 * Implementation of cronapi_cronapi();
 * If any last minute adjustments are needed before the preset is ran...
 * This is where they should be done.
 *
 * @param $op
 *   String - 'rotate', 'update', 'insert', 'delete'
 * @param $preset
 *   The preset array structure that is being invoked.
 */
function cronapi_cronapi($op = NULL, $preset = NULL) {
  switch ($op) {
    case 'rotate':
    break;
    case 'update':
    break;
    case 'insert':
    break;
    case 'delete':
    break;
    default:
    break;
  }// end - switch
  
  return $preset;
}// end - function
?>

Project information

  • Module categories: Developer
  • chart icon638 downloads
  • shield alertThis project is not covered by the security advisory policy.
    Use at your own risk! It may have publicly disclosed vulnerabilities.

Downloads