You are here

function ultimate_cron_get_settings in Ultimate Cron 8

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

Get settings for a function.

Parameters

$name:

Return value

array Settings for function

6 calls to ultimate_cron_get_settings()
drush_ultimate_cron_cron_disable in ./ultimate_cron.drush.inc
Disable a cron job
drush_ultimate_cron_cron_enable in ./ultimate_cron.drush.inc
Enable a cron job
ultimate_cron_cronapi in ./ultimate_cron.module
Implements hook_cronapi().
ultimate_cron_function_settings_form in ./ultimate_cron.admin.inc
Function settings form.
ultimate_cron_load_hook_data in ./ultimate_cron.module
Populate hook array with settings and log data

... See full list

File

./ultimate_cron.module, line 1092
@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_get_settings($name) {
  $settings = array();
  if (module_exists('ctools')) {
    ctools_include('export');
    $function = ctools_export_crud_load('ultimate_cron', $name);
    if ($function) {
      $settings = (array) $function->settings;
    }
  }
  else {
    $function = db_query("SELECT settings FROM {ultimate_cron} WHERE name = :name", array(
      ':name' => $name,
    ))
      ->fetchObject();
    if (!empty($function) && !empty($function->settings)) {
      $settings = (array) unserialize($function->settings);
    }
  }
  if (empty($settings['catch_up'])) {
    unset($settings['catch_up']);
  }
  return $settings;
}