You are here

function civicrm_cron_cron in CiviCRM Cron 7

Same name and namespace in other branches
  1. 8 civicrm_cron.module \civicrm_cron_cron()
  2. 6 civicrm_cron.module \civicrm_cron_cron()
  3. 7.2 civicrm_cron.module \civicrm_cron_cron()

Implementation of hook_cron().

File

./civicrm_cron.module, line 101
CiviCRM Cron Module

Code

function civicrm_cron_cron() {
  $cron_values['name'] = variable_get('civicrm_cron_username', NULL);
  $cron_values['pass'] = variable_get('civicrm_cron_password', NULL);
  $cron_values['key'] = variable_get('civicrm_cron_sitekey', CIVICRM_SITE_KEY);
  $url = civicrm_cron_get_url($cron_values);
  if ($url) {
    $result = drupal_http_request($url);

    //look for the CiviCRM error in response... successful processing returns nothing
    if ($result->data) {
      watchdog('civirm_cron', $result->data);
    }
    else {
      watchdog('civirm_cron', t('CiviCRM Cron Successfully Run'));
    }
  }
}