You are here

function ultimate_cron_get_easy_hooks in Ultimate Cron 7.2

Cron easy hooks.

Provide a default set of easy hooks.

Return value

array Easy hooks.

2 calls to ultimate_cron_get_easy_hooks()
ultimate_cron_get_module_hooks in ./ultimate_cron.module
Get cron hooks declared by a module.
ultimate_cron_hook_info in ./ultimate_cron.module
Implements hook_hook_info().

File

./ultimate_cron.module, line 1205

Code

function ultimate_cron_get_easy_hooks() {
  static $easy_hooks;
  if (isset($easy_hooks)) {
    return $easy_hooks;
  }

  // Default provided easy hooks.
  $easy_hooks = array(
    'cron' => array(
      'title' => 'Default cron job',
    ),
    'cron_hourly' => array(
      'title' => 'Hourly cron job',
      'scheduler' => array(
        'name' => 'crontab',
        'crontab' => array(
          'rules' => array(
            '0+@ * * * *',
          ),
        ),
      ),
    ),
    'cron_daily' => array(
      'title' => 'Daily cron job',
      'scheduler' => array(
        'name' => 'crontab',
        'crontab' => array(
          'rules' => array(
            '0+@ 12 * * *',
          ),
        ),
      ),
    ),
    'cron_nightly' => array(
      'title' => 'Nightly cron job',
      'scheduler' => array(
        'name' => 'crontab',
        'crontab' => array(
          'rules' => array(
            '0+@ 0 * * *',
          ),
        ),
      ),
    ),
    'cron_weekly' => array(
      'title' => 'Weekly cron job',
      'scheduler' => array(
        'name' => 'crontab',
        'crontab' => array(
          'rules' => array(
            '0+@ 0 * * 1',
          ),
        ),
      ),
    ),
    'cron_monthly' => array(
      'title' => 'Monthly cron job',
      'scheduler' => array(
        'name' => 'crontab',
        'crontab' => array(
          'rules' => array(
            '0+@ 0 1 * *',
          ),
        ),
      ),
    ),
    'cron_yearly' => array(
      'title' => 'Yearly cron job',
      'scheduler' => array(
        'name' => 'crontab',
        'crontab' => array(
          'rules' => array(
            '0+@ 0 1 1 *',
          ),
        ),
      ),
    ),
  );

  // Allow modules to define their own easy hooks.
  $easy_hooks += module_invoke_all('cron_easy_hooks');

  // Allow modules to alter the defined easy hooks.
  drupal_alter('cron_easy_hooks', $easy_hooks);
  return $easy_hooks;
}