You are here

function drush_ultimate_cron_cron_enable in Ultimate Cron 7

Same name and namespace in other branches
  1. 8.2 ultimate_cron.drush.inc \drush_ultimate_cron_cron_enable()
  2. 8 ultimate_cron.drush.inc \drush_ultimate_cron_cron_enable()
  3. 6 ultimate_cron.drush.inc \drush_ultimate_cron_cron_enable()
  4. 7.2 ultimate_cron.drush.inc \drush_ultimate_cron_cron_enable()

Enable a cron job

File

./ultimate_cron.drush.inc, line 314
Drush commands for Ultimate Cron!

Code

function drush_ultimate_cron_cron_enable($function) {
  $hooks = ultimate_cron_get_hooks();
  if (!isset($hooks[$function])) {
    return drush_set_error(dt('"!function" not found', array(
      '!function' => $function,
    )));
  }
  $conf = ultimate_cron_get_settings($function);
  $conf['enabled'] = TRUE;
  ultimate_cron_set_settings($function, $conf);
  drush_print(dt('!function enabled', array(
    '!function' => $function,
  )));
}