You are here

function civicrm_cron_install in CiviCRM Cron 8

Implements hook_install().

File

./civicrm_cron.install, line 11
CiviCRM Cron installation code.

Code

function civicrm_cron_install() {
  \Drupal::service('civicrm')
    ->initialize();
  $config = \Drupal::configFactory()
    ->getEditable('civicrm_cron.settings');
  if (!$config
    ->get('sitekey') && defined('CIVICRM_SITE_KEY')) {
    $config
      ->set('sitekey', CIVICRM_SITE_KEY);
    $config
      ->save();
  }
}