function civicrm_cron_get_url in CiviCRM Cron 6
Same name and namespace in other branches
- 7 civicrm_cron.module \civicrm_cron_get_url()
2 calls to civicrm_cron_get_url()
- civicrm_cron_admin_settings in ./civicrm_cron.module 
- Builds the civicrm_cron admininstration settings form.
- civicrm_cron_cron in ./civicrm_cron.module 
File
- ./civicrm_cron.module, line 146 
- Civicrm Cron Module Uses _cron for drupals cron job to trigger civicrm's new Consolidated Cron Jobs used by Visions Service Adventures website
Code
function civicrm_cron_get_url($cron_values) {
  if ($cron_values['name'] && $cron_values['pass'] && $cron_values['key']) {
    global $base_url;
    $civicrm_path = drupal_get_path('module', 'civicrm');
    //remove the last occurrence of 'drupal' from path
    $pos = strrpos($civicrm_path, 'drupal');
    if ($pos !== false) {
      $civicrm_path = substr_replace($civicrm_path, '', $pos, strlen($civicrm_path));
    }
    $url = $civicrm_path . 'bin/cron.php';
    return $base_url . url($url, array(
      'query' => $cron_values,
    ));
  }
  return FALSE;
}