You are here

function ultimate_cron_easy_hooks_rule in Ultimate Cron 8

Same name and namespace in other branches
  1. 6 ultimate_cron.module \ultimate_cron_easy_hooks_rule()
  2. 7 ultimate_cron.module \ultimate_cron_easy_hooks_rule()

Get rule(s) for easy hook(s)

Parameters

$hook: Hook to get rule for (optional).

Return value

mixed Rule for $hook if specified, otherwise all rules for all easy hooks.

1 call to ultimate_cron_easy_hooks_rule()
ultimate_cron_get_hooks in ./ultimate_cron.module
Get cron hooks available.

File

./ultimate_cron.module, line 1275
@todo Add filter on overview page. @todo Add log view (with graph). @todo Make proper markup for overview page. @todo Refactor drush stuff, too many intimate relations with Background Process @todo Refactor Cron % offset stuff. Too mixed up and…

Code

function ultimate_cron_easy_hooks_rule($hook = NULL) {
  $rules = array(
    'cron' => variable_get('ultimate_cron_rule', ULTIMATE_CRON_RULE),
    'hourly' => ULTIMATE_CRON_HOURLY_RULE,
    'daily' => ULTIMATE_CRON_DAILY_RULE,
    'weekly' => ULTIMATE_CRON_WEEKLY_RULE,
    'monthly' => ULTIMATE_CRON_MONTHLY_RULE,
    'yearly' => ULTIMATE_CRON_YEARLY_RULE,
  );
  return isset($rules[$hook]) ? $rules[$hook] : variable_get('ultimate_cron_rule', ULTIMATE_CRON_RULE);
}