You are here

function biblio_cron in Bibliography Module 7

Same name and namespace in other branches
  1. 6.2 biblio.module \biblio_cron()
  2. 6 biblio.module \biblio_cron()
  3. 7.2 biblio.module \biblio_cron()

Implements hook_cron().

File

./biblio.module, line 152
Bibliography Module for Drupal.

Code

function biblio_cron() {
  $path = drupal_get_path('module', 'biblio');
  require_once $path . '/includes/biblio.contributors.inc';
  require_once $path . '/includes/biblio.keywords.inc';

  // Defaults to once per day.
  $interval = variable_get('biblio_orphan_clean_interval', 24 * 60 * 60);
  if (time() >= variable_get('biblio_orphan_clean_next_execution', 0)) {
    biblio_delete_orphan_authors();
    biblio_delete_orphan_keywords();
    variable_set('biblio_orphan_clean_next_execution', time() + $interval);
  }
}